public class ParentFunction extends java.lang.Object implements CtConsumableFunction<CtElement>, CtQueryAware
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 trueConstructor and Description |
---|
ParentFunction() |
Modifier and Type | Method and Description |
---|---|
void |
apply(CtElement input,
CtConsumer<java.lang.Object> outputConsumer)
Evaluates the function on the given input.
|
ParentFunction |
includingSelf(boolean includingSelf) |
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 ParentFunction includingSelf(boolean includingSelf)
includingSelf
- if true then input element is sent to output too. By default it is false.public void apply(CtElement input, CtConsumer<java.lang.Object> outputConsumer)
CtConsumableFunction
apply
in interface CtConsumableFunction<CtElement>
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.Copyright © 2007–2021 Inria. All rights reserved.