Package spoon.reflect.visitor.filter
Class LocalVariableReferenceFunction
java.lang.Object
spoon.reflect.visitor.filter.LocalVariableReferenceFunction
- All Implemented Interfaces:
CtConsumableFunction<CtElement>
- Direct Known Subclasses:
CatchVariableReferenceFunction
,ParameterReferenceFunction
public class LocalVariableReferenceFunction
extends Object
implements CtConsumableFunction<CtElement>
This mapping function expects a
Usage:
CtLocalVariable
as input
and returns all CtLocalVariableReference
s, which refers this input.
Usage:
CtLocalVariable var = ...;
var
.map(new LocalVariableReferenceFunction())
.forEach((CtLocalVariableReference ref)->...process references...);
-
Constructor Summary
ConstructorDescriptionLocalVariableReferenceFunction(CtLocalVariable<?> localVariable)
This constructor allows to define input local variable - the one for which this function will search for. -
Method Summary
Modifier and TypeMethodDescriptionvoid
apply(CtElement scope, CtConsumer<Object> outputConsumer)
Evaluates the function on the given input.
-
Constructor Details
-
LocalVariableReferenceFunction
public LocalVariableReferenceFunction() -
LocalVariableReferenceFunction
This constructor allows to define input local variable - the one for which this function will search for. In such case the input of mapping function represents the scope where this local variable is searched for.- Parameters:
localVariable
- - the local variable declaration which is searched in scope of input element of this mapping function.
-
-
Method Details
-
apply
Description copied from interface:CtConsumableFunction
Evaluates the function on the given input.- Specified by:
apply
in interfaceCtConsumableFunction<CtElement>
- Parameters:
scope
- the input of the functionoutputConsumer
- the consumer which accepts the results of this function.
-