Package spoon.reflect.visitor.filter
Class AllMethodsSameSignatureFunction
java.lang.Object
spoon.reflect.visitor.filter.AllMethodsSameSignatureFunction
- All Implemented Interfaces:
CtConsumableFunction<CtExecutable<?>>
,CtQueryAware
public class AllMethodsSameSignatureFunction
extends Object
implements CtConsumableFunction<CtExecutable<?>>, CtQueryAware
Returns all methods/lambdas with same signature in related inheritance hierarchies.
It can be be used to found all other methods, which has to be changed if signature of method or lambda expression has to be changed.
Expects
It makes sense to call this mapping functions for
Expects
CtExecutable
as input
and produces all CtExecutable
s,
which have same signature and are declared in sub/super classes or sub/super interfaces of this or related inheritance hierarchy.It makes sense to call this mapping functions for
CtMethod
and CtLambda
instances
and then it returns CtMethod
and CtLambda
instance which overrides each other or have same signature.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
apply(CtExecutable<?> targetExecutable, CtConsumer<Object> outputConsumer)
Evaluates the function on the given input.includingLambdas(boolean includingLambdas)
includingSelf(boolean includingSelf)
void
This method is called when the filter/function is added as a step to aCtQuery
by the query engine (CtQueryImpl
).
-
Constructor Details
-
AllMethodsSameSignatureFunction
public AllMethodsSameSignatureFunction()
-
-
Method Details
-
includingSelf
- Parameters:
includingSelf
- if true then input element is sent to output too. By default it is false.
-
includingLambdas
-
apply
Description copied from interface:CtConsumableFunction
Evaluates the function on the given input.- Specified by:
apply
in interfaceCtConsumableFunction<CtExecutable<?>>
- Parameters:
targetExecutable
- the input of the functionoutputConsumer
- the consumer which accepts the results of this function.
-
setQuery
Description copied from interface:CtQueryAware
This method is called when the filter/function is added as a step to aCtQuery
by the query engine (CtQueryImpl
).- Specified by:
setQuery
in interfaceCtQueryAware
- Parameters:
query
- an instance registering this function/filter.
-