Package spoon.reflect.visitor.filter
Class CtScannerFunction
java.lang.Object
spoon.reflect.visitor.filter.CtScannerFunction
- All Implemented Interfaces:
CtConsumableFunction<CtElement>,CtQueryAware
public class CtScannerFunction
extends Object
implements CtConsumableFunction<CtElement>, CtQueryAware
Returns all children of an element.
More than this, it is a parameterizable class to be subclassed which provides all the power of
In particular, one can a register a
CtScanner in the context of queries.
In particular, one can a register a
CtScannerListener, it is called-back when entering/exiting each scanned AST node
and it drives the scanning process (see ScanningMode).-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidapply(CtElement input, CtConsumer<Object> outputConsumer) Evaluates the function on the given input.includingSelf(boolean includingSelf) setListener(CtScannerListener listener) voidThis method is called when the filter/function is added as a step to aCtQueryby the query engine (CtQueryImpl).
-
Constructor Details
-
CtScannerFunction
public CtScannerFunction()
-
-
Method Details
-
includingSelf
- Parameters:
includingSelf- if true then input element is sent to output too. By default it is false.
-
setListener
- Parameters:
listener- the implementation ofCtScannerListener, which will listen for enter/exit of nodes during scanning of AST- Returns:
- this to support fluent API
-
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.
-