|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.chemistry.opencmis.jcr.query.ParseTreeWalker<T>
T
- type of the result determined by the Evaluator
used.public class ParseTreeWalker<T>
This implementation of PredicateWalkerBase
traverses the parse tree of a CMIS query.
It uses an Evaluator
to accumulate the result of the traversal. Evaluator
has a corresponding method for each node type
in the parse tree.
ParseTreeWalker
calls these methods while traversing the parse tree passing an
Evaluator
for each of the corresponding operation's arguments.
The walkPredicate(Tree)
serves as entry point for traversing a parse tree. After
successful traversal, the result is obtained from the getResult()
method.
Constructor Summary | |
---|---|
ParseTreeWalker(Evaluator<T> evaluator)
Create a new instance for traversing CMIS query parse trees. |
Method Summary | |
---|---|
T |
getResult()
Retrieve the result of a successful traversal. |
protected T |
walkOtherExpr(Evaluator evaluator,
org.antlr.runtime.tree.Tree node)
For extensibility. |
protected T |
walkOtherPredicate(Evaluator evaluator,
org.antlr.runtime.tree.Tree node)
For extensibility. |
Boolean |
walkPredicate(org.antlr.runtime.tree.Tree node)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ParseTreeWalker(Evaluator<T> evaluator)
evaluator
- Evaluator
for evaluating the nodes of the parse treeMethod Detail |
---|
public T getResult()
null
if either not yet traversed, an error occurred
on traversal or the query has an empty where clause.public Boolean walkPredicate(org.antlr.runtime.tree.Tree node)
walkPredicate
in interface PredicateWalkerBase
protected T walkOtherExpr(Evaluator evaluator, org.antlr.runtime.tree.Tree node)
protected T walkOtherPredicate(Evaluator evaluator, org.antlr.runtime.tree.Tree node)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |