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
-
Method Summary
Modifier and TypeMethodDescriptionvoid
apply(CtField<?> field, CtConsumer<Object> outputConsumer)
Evaluates the function on the given input.protected void
searchForPackageProtectedField(CtField<?> field, CtConsumer<Object> outputConsumer)
protected void
searchForPrivateField(CtField<?> field, CtConsumer<Object> outputConsumer)
protected void
searchForProtectedField(CtField<?> field, CtConsumer<Object> outputConsumer)
protected void
searchForPublicField(CtField<?> field, CtConsumer<Object> outputConsumer)
-
Constructor Details
-
FieldScopeFunction
public FieldScopeFunction()
-
-
Method Details
-
apply
Description copied from interface:CtConsumableFunction
Evaluates the function on the given input.- Specified by:
apply
in interfaceCtConsumableFunction<CtField<?>>
- Parameters:
field
- the input of the functionoutputConsumer
- the consumer which accepts the results of this function.
-
searchForPrivateField
-
searchForProtectedField
-
searchForPublicField
-
searchForPackageProtectedField
-