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 CtExecutables,
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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidapply(CtExecutable<?> targetExecutable, CtConsumer<Object> outputConsumer) Evaluates the function on the given input.includingLambdas(boolean includingLambdas) includingSelf(boolean includingSelf) voidThis method is called when the filter/function is added as a step to aCtQueryby 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:CtConsumableFunctionEvaluates the function on the given input.- Specified by:
applyin interfaceCtConsumableFunction<CtExecutable<?>>- Parameters:
targetExecutable- the input of the functionoutputConsumer- the consumer which accepts the results of this function.
-
setQuery
Description copied from interface:CtQueryAwareThis method is called when the filter/function is added as a step to aCtQueryby the query engine (CtQueryImpl).- Specified by:
setQueryin interfaceCtQueryAware- Parameters:
query- an instance registering this function/filter.
-