QueryNodeProcessorImpl

This is a default implementation for the QueryNodeProcessor interface, it's an abstract class, so it should be extended by classes that want to process a QueryNode tree.

This class process QueryNodes from left to right in the tree. While it's walking down the tree, for every node, preProcessNode is invoked. After a node's children are processed, postProcessNode is invoked for that node. setChildrenOrder is invoked before postProcessNode only if the node has at least one child, in setChildrenOrder the implementor might redefine the children order or remove any children from the children list.

Here is an example about how it process the nodes:

    a
/ \
b e
/ \
c d

Here is the order the methods would be invoked for the tree described above:

    preProcessNode( a );
preProcessNode( b );
preProcessNode( c );
postProcessNode( c );
preProcessNode( d );
postProcessNode( d );
setChildrenOrder( bChildrenList );
postProcessNode( b );
preProcessNode( e );
postProcessNode( e );
setChildrenOrder( aChildrenList );
postProcessNode( a )

See also

Inheritors

Constructors

Link copied to clipboard
constructor()
constructor(queryConfigHandler: QueryConfigHandler)

Properties

Link copied to clipboard

Sets and returns the QueryConfigHandler associated to the query tree.

Functions

Link copied to clipboard
open override fun process(queryTree: QueryNode): QueryNode

Processes a query node tree. It may return the same or another query tree. I should never return null.