|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.voytechs.jnetstream.npl.Visitor
com.voytechs.jnetstream.codec.filter.FilterAliases
public class FilterAliases
Sets up aliases for the filter. This class implements the Visitor pattern and traverses the passed AST searching for for "filter" statements. There are several modifiers on the FilterStatement, we're interested here in "filter alias".
| Nested Class Summary | |
|---|---|
class |
FilterAliases.AliasEntry
Inner class that makes up an Alias entry stored in our hash. |
| Constructor Summary | |
|---|---|
FilterAliases()
Initializes an empty aliases object. |
|
FilterAliases(NodeList root)
Initializes the aliases object with AST. |
|
| Method Summary | |
|---|---|
static void |
main(java.lang.String[] args)
Test function for FilterAliases |
void |
subAliases(NodeList expression)
Substitutes aliases for within the given expression when matches are found. |
boolean |
traverse(FilterStatement stat,
java.lang.Object opath,
java.lang.Object user2)
During Visitor traversal record values of the filter statement. |
boolean |
traverse(HeaderStatement stat,
java.lang.Object opath,
java.lang.Object user2)
During Visitor traversal recods the header statement onto a stack. |
boolean |
traverse(MutableReferenceNode ref,
java.lang.Object user1,
java.lang.Object user2)
During Visitor traversal checks for any possible matches with list of defined aliases. |
| Methods inherited from class com.voytechs.jnetstream.npl.Visitor |
|---|
traverse, traverse, traverse, traverse, traverse, traverse, traverse, traverse, traverse, traverse, traverse, traverse, traverse, traverse, traverse, traverse, traverse, traverse, traverse, traverse, traverse, traverse, traverse, traverse, visit |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public FilterAliases()
public FilterAliases(NodeList root)
throws NodeException
root - The root of the Abstract Syntax Tree. This is where the traversal
starts.
NodeException| Method Detail |
|---|
public void subAliases(NodeList expression)
throws NodeException
NodeException
public boolean traverse(MutableReferenceNode ref,
java.lang.Object user1,
java.lang.Object user2)
throws NodeException
traverse in class Visitorref - Reference node to be aliased. Aliases only work on reference nodes.
NodeException
public boolean traverse(HeaderStatement stat,
java.lang.Object opath,
java.lang.Object user2)
throws NodeException
traverse in class Visitorstat - Header statement node which contains many details.opath - A stack which contains the path as made up of Headers where the
filter statement was declared.
NodeException
public boolean traverse(FilterStatement stat,
java.lang.Object opath,
java.lang.Object user2)
throws NodeException
traverse in class Visitorstat - The filter statement node, which contains all of the statements
paramaters.opath - A stack which contains the path as made up of Headers where the
filter statement was declared.user2 - Not used.
NodeExceptionpublic static void main(java.lang.String[] args)
args - command line arguments
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||