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