Package spoon.reflect.visitor.filter
Class LocalVariableScopeFunction
java.lang.Object
spoon.reflect.visitor.filter.LocalVariableScopeFunction
- All Implemented Interfaces:
CtConsumableFunction<CtLocalVariable<?>>
public class LocalVariableScopeFunction
extends Object
implements CtConsumableFunction<CtLocalVariable<?>>
This Query expects a
It can be used to search for variable declarations or variable references which might be in name conflict with input local variable.
Usage:
CtLocalVariable as input
and returns all CtElements,
which are in visibility scope of that local variable.
In other words, it returns all elements,
which might be reference to that local variable.
It can be used to search for variable declarations or variable references which might be in name conflict with input local variable.
Usage:
CtLocalVariable var = ...;
var.map(new LocalVariableScopeFunction()).forEach(...process result...);
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidapply(CtLocalVariable<?> localVariable, CtConsumer<Object> outputConsumer) Evaluates the function on the given input.
-
Constructor Details
-
LocalVariableScopeFunction
public LocalVariableScopeFunction() -
LocalVariableScopeFunction
-
-
Method Details
-
apply
Description copied from interface:CtConsumableFunctionEvaluates the function on the given input.- Specified by:
applyin interfaceCtConsumableFunction<CtLocalVariable<?>>- Parameters:
localVariable- the input of the functionoutputConsumer- the consumer which accepts the results of this function.
-