|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.lucene.queryParser.core.processors.QueryNodeProcessorImpl
public abstract class 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 QueryNode
s 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 dHere 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 )
QueryNodeProcessor
Constructor Summary | |
---|---|
QueryNodeProcessorImpl()
|
|
QueryNodeProcessorImpl(QueryConfigHandler queryConfigHandler)
|
Method Summary | |
---|---|
QueryConfigHandler |
getQueryConfigHandler()
For reference about this method check: QueryNodeProcessor.getQueryConfigHandler() . |
protected abstract QueryNode |
postProcessNode(QueryNode node)
This method is invoked for every node when walking up the tree. |
protected abstract QueryNode |
preProcessNode(QueryNode node)
This method is invoked for every node when walking down the tree. |
QueryNode |
process(QueryNode queryTree)
Processes a query node tree. |
protected void |
processChildren(QueryNode queryTree)
This method is called every time a child is processed. |
protected abstract List<QueryNode> |
setChildrenOrder(List<QueryNode> children)
This method is invoked for every node that has at least on child. |
void |
setQueryConfigHandler(QueryConfigHandler queryConfigHandler)
For reference about this method check: QueryNodeProcessor.setQueryConfigHandler(QueryConfigHandler) . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public QueryNodeProcessorImpl()
public QueryNodeProcessorImpl(QueryConfigHandler queryConfigHandler)
Method Detail |
---|
public QueryNode process(QueryNode queryTree) throws QueryNodeException
QueryNodeProcessor
null
.
process
in interface QueryNodeProcessor
queryTree
- tree root node
QueryNodeException
protected void processChildren(QueryNode queryTree) throws QueryNodeException
queryTree
- the query node child to be processed
QueryNodeException
- if something goes wrong during the query node processingpublic void setQueryConfigHandler(QueryConfigHandler queryConfigHandler)
QueryNodeProcessor.setQueryConfigHandler(QueryConfigHandler)
.
setQueryConfigHandler
in interface QueryNodeProcessor
queryConfigHandler
- the query configuration handler to be set.QueryNodeProcessor.getQueryConfigHandler()
,
QueryConfigHandler
public QueryConfigHandler getQueryConfigHandler()
QueryNodeProcessor.getQueryConfigHandler()
.
getQueryConfigHandler
in interface QueryNodeProcessor
QueryNodeProcessor.setQueryConfigHandler(QueryConfigHandler)
,
QueryConfigHandler
protected abstract QueryNode preProcessNode(QueryNode node) throws QueryNodeException
node
- the query node to be pre-processed
QueryNodeException
- if something goes wrong during the query node processingprotected abstract QueryNode postProcessNode(QueryNode node) throws QueryNodeException
node
- node the query node to be post-processed
QueryNodeException
- if something goes wrong during the query node processingprotected abstract List<QueryNode> setChildrenOrder(List<QueryNode> children) throws QueryNodeException
postProcessNode(QueryNode)
is invoked.
children
- the list containing all current node's children
QueryNodeException
- if something goes wrong during the query node processing
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |