Class QueryNodeProcessorImpl

java.lang.Object
org.apache.lucene.queryparser.flexible.core.processors.QueryNodeProcessorImpl
All Implemented Interfaces:
QueryNodeProcessor
Direct Known Subclasses:
AllowLeadingWildcardProcessor, AnalyzerQueryNodeProcessor, BooleanModifiersQueryNodeProcessor, BooleanSingleChildOptimizationQueryNodeProcessor, BoostQueryNodeProcessor, DefaultPhraseSlopQueryNodeProcessor, FuzzyQueryNodeProcessor, IntervalQueryNodeProcessor, MatchAllDocsQueryNodeProcessor, MultiFieldQueryNodeProcessor, MultiTermRewriteMethodProcessor, NoChildOptimizationQueryNodeProcessor, OpenRangeQueryNodeProcessor, PhraseSlopQueryNodeProcessor, PointQueryNodeProcessor, PointRangeQueryNodeProcessor, RegexpQueryNodeProcessor, RemoveDeletedQueryNodesProcessor, RemoveEmptyNonLeafQueryNodeProcessor, TermRangeQueryNodeProcessor, WildcardQueryNodeProcessor

public abstract class QueryNodeProcessorImpl extends Object implements QueryNodeProcessor
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(QueryNode) is invoked. After a node's children are processed, postProcessNode(QueryNode) is invoked for that node. setChildrenOrder(List) is invoked before postProcessNode(QueryNode) only if the node has at least one child, in setChildrenOrder(List) 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: