Package spoon.reflect.visitor.filter
Class AllTypeMembersFunction
java.lang.Object
spoon.reflect.visitor.filter.AllTypeMembersFunction
- All Implemented Interfaces:
CtConsumableFunction<CtTypeInformation>,CtQueryAware
public class AllTypeMembersFunction
extends Object
implements CtConsumableFunction<CtTypeInformation>, CtQueryAware
Expects
CtType as input
and produces all CtTypeMembers declared in input class
or any super class or super interface.
It first returns own type members, then type members of superclass, etc.-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionreturns all type membersAllTypeMembersFunction(Class<?> memberClass) returns all type members which are instance of `memberClass`.
Example:
CtField allFields = ctType.map(new AllTypeMembersFunction(CtField.class)).list(); -
Method Summary
Modifier and TypeMethodDescriptionvoidapply(CtTypeInformation input, CtConsumer<Object> outputConsumer) Evaluates the function on the given input.distinctSet(Set<String> distinctSet) The types whose qualified name is in distinctSet are not visited.voidThis method is called when the filter/function is added as a step to aCtQueryby the query engine (CtQueryImpl).
-
Constructor Details
-
AllTypeMembersFunction
public AllTypeMembersFunction()returns all type members -
AllTypeMembersFunction
returns all type members which are instance of `memberClass`.
Example:
CtField allFields = ctType.map(new AllTypeMembersFunction(CtField.class)).list();
-
-
Method Details
-
distinctSet
The types whose qualified name is in distinctSet are not visited. The qualified name of each type visited by this mapping function is added to `distinctSet`- Parameters:
distinctSet- - Set of qualified names of types, which has to be ignored, because they were already processed
-
apply
Description copied from interface:CtConsumableFunctionEvaluates the function on the given input.- Specified by:
applyin interfaceCtConsumableFunction<CtTypeInformation>- Parameters:
input- 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.
-
setMode
- Parameters:
mode- defines how whether type members with limited visibility are returned
-