T
- type of the result determined by the Evaluator
used.public class ParseTreeWalker<T> extends Object implements PredicateWalkerBase
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 and Description |
---|
ParseTreeWalker(Evaluator<T> evaluator)
Create a new instance for traversing CMIS query parse trees.
|
Modifier and Type | Method and Description |
---|---|
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) |
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)
Copyright © 2009-2014 The Apache Software Foundation. All Rights Reserved.