public class AllTypeMembersFunction extends java.lang.Object implements CtConsumableFunction<CtTypeInformation>, CtQueryAware
CtType
as input
and produces all CtTypeMember
s declared in input class
or any super class or super interface.
It first returns own type members, then type members of superclass, etc.Modifier and Type | Class and Description |
---|---|
static class |
AllTypeMembersFunction.Mode |
Constructor and Description |
---|
AllTypeMembersFunction()
returns all type members
|
AllTypeMembersFunction(java.lang.Class<?> memberClass)
returns all type members which are instance of `memberClass`.
Example:
CtField allFields = ctType.map(new AllTypeMembersFunction(CtField.class)).list();
|
Modifier and Type | Method and Description |
---|---|
void |
apply(CtTypeInformation input,
CtConsumer<java.lang.Object> outputConsumer)
Evaluates the function on the given input.
|
AllTypeMembersFunction |
distinctSet(java.util.Set<java.lang.String> distinctSet)
The types whose qualified name is in distinctSet are not visited.
|
AllTypeMembersFunction |
setMode(AllTypeMembersFunction.Mode mode) |
void |
setQuery(CtQuery query)
This method is called when the filter/function is added as a step to a
CtQuery by the query engine (CtQueryImpl ). |
public AllTypeMembersFunction()
public AllTypeMembersFunction(java.lang.Class<?> memberClass)
CtField allFields = ctType.map(new AllTypeMembersFunction(CtField.class)).list();
public AllTypeMembersFunction distinctSet(java.util.Set<java.lang.String> distinctSet)
distinctSet
- - Set of qualified names of types, which has to be ignored, because they were already processedpublic void apply(CtTypeInformation input, CtConsumer<java.lang.Object> outputConsumer)
CtConsumableFunction
apply
in interface CtConsumableFunction<CtTypeInformation>
input
- the input of the functionoutputConsumer
- the consumer which accepts the results of this function.public void setQuery(CtQuery query)
CtQueryAware
CtQuery
by the query engine (CtQueryImpl
).setQuery
in interface CtQueryAware
query
- an instance registering this function/filter.public AllTypeMembersFunction setMode(AllTypeMembersFunction.Mode mode)
mode
- defines how whether type members with limited visibility are returnedCopyright © 2007–2021 Inria. All rights reserved.