Package spoon.reflect.visitor.filter
Class ParentFunction
java.lang.Object
spoon.reflect.visitor.filter.ParentFunction
- All Implemented Interfaces:
CtConsumableFunction<CtElement>
,CtQueryAware
This Function expects a
CtElement
as input
and returns all parents of this element.
By default input is not returned,
but this behavior can be changed by call of includingSelf(boolean)
with value true-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
apply(CtElement input, CtConsumer<Object> outputConsumer)
Evaluates the function on the given input.includingSelf(boolean includingSelf)
void
This method is called when the filter/function is added as a step to aCtQuery
by the query engine (CtQueryImpl
).
-
Constructor Details
-
ParentFunction
public ParentFunction()
-
-
Method Details
-
includingSelf
- Parameters:
includingSelf
- if true then input element is sent to output too. By default it is false.
-
apply
Description copied from interface:CtConsumableFunction
Evaluates the function on the given input.- Specified by:
apply
in interfaceCtConsumableFunction<CtElement>
- Parameters:
input
- the input of the functionoutputConsumer
- the consumer which accepts the results of this function.
-
setQuery
Description copied from interface:CtQueryAware
This method is called when the filter/function is added as a step to aCtQuery
by the query engine (CtQueryImpl
).- Specified by:
setQuery
in interfaceCtQueryAware
- Parameters:
query
- an instance registering this function/filter.
-