Package spoon.reflect.visitor.filter
Class SiblingsFunction
java.lang.Object
spoon.reflect.visitor.filter.SiblingsFunction
- All Implemented Interfaces:
CtConsumableFunction<CtElement>
visits siblings of input element.
The sibling is the element whose sibling.getParent()==input.getParent()
The siblings are visited in order in which they would be visited by CtScanner. The input element is by default not visited. But if
The siblings are visited in order in which they would be visited by CtScanner. The input element is by default not visited. But if
includingSelf(boolean)
is called with value true,
then input element is visited too in the order in which CtScanner would visit it.
The visiting order is relevant, because this scanner is used for example resolve local variable declarations.-
Nested Class Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
apply(CtElement input, CtConsumer<Object> outputConsumer)
Evaluates the function on the given input.includingSelf(boolean includingSelf)
mode(SiblingsFunction.Mode mode)
-
Constructor Details
-
SiblingsFunction
public SiblingsFunction()
-
-
Method Details
-
includingSelf
- Parameters:
includingSelf
- if false then input element is not visited
-
mode
- Parameters:
mode
- defines which siblings will be visited. SeeSiblingsFunction.Mode
for possible values
-
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.
-