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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidapply(CtElement input, CtConsumer<Object> outputConsumer) Evaluates the function on the given input.includingSelf(boolean includingSelf) voidThis method is called when the filter/function is added as a step to aCtQueryby 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:CtConsumableFunctionEvaluates the function on the given input.- Specified by:
applyin interfaceCtConsumableFunction<CtElement>- 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.
-