java.lang.Object | |
↳ | org.hibernate.hql.ast.util.ASTUtil |
Provides utility methods for AST traversal and manipulation.
Nested Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
ASTUtil.FilterPredicate | Filters nodes out of a tree. | ||||||||||
ASTUtil.IncludePredicate | A predicate that uses inclusion, rather than exclusion semantics. |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
This method is deprecated.
silly
| |||||||||||
Creates a 'binary operator' subtree, given the information about the
parent and the two child nodex.
| |||||||||||
Creates a single parent of the specified child (i.e.
| |||||||||||
Creates a single node AST as a sibling of the passed prevSibling,
taking care to reorganize the tree correctly to account for this
newly created node.
| |||||||||||
Find the previous sibling in the parent for the given child.
| |||||||||||
Finds the first node of the specified type in the chain of children.
| |||||||||||
Method to generate a map of token type names, keyed by their token type values.
| |||||||||||
This method is deprecated.
Use #getTokenTypeName instead
| |||||||||||
Returns the 'list' representation with some brackets around it for debugging.
| |||||||||||
Returns the last direct child of 'n'.
| |||||||||||
Intended to retrieve the name of an AST token type based on the token type interface.
| |||||||||||
Inserts the child as the first child of the parent, all other children are shifted over to the 'right'.
| |||||||||||
Inserts a node into a child subtree as a particularly positioned
sibling taking care to properly reorganize the tree to account for this
new addition.
| |||||||||||
Determine if a given node (test) is contained anywhere in the subtree
of another given node (fixture).
| |||||||||||
Makes the child node a sibling of the parent, reconnecting all siblings.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
This method is deprecated.
silly
Creates a single node AST.
TODO : this is silly, remove it...astFactory | The factory. |
---|---|
type | The node type. |
text | The node text. |
Creates a 'binary operator' subtree, given the information about the parent and the two child nodex.
factory | The AST factory. |
---|---|
parentType | The type of the parent node. |
parentText | The text of the parent node. |
child1 | The first child. |
child2 | The second child. |
Creates a single parent of the specified child (i.e. a 'unary operator' subtree).
factory | The AST factory. |
---|---|
parentType | The type of the parent node. |
parentText | The text of the parent node. |
child | The child. |
Creates a single node AST as a sibling of the passed prevSibling, taking care to reorganize the tree correctly to account for this newly created node.
astFactory | The factory. |
---|---|
type | The node type. |
text | The node text. |
prevSibling | The previous sibling. |
Find the previous sibling in the parent for the given child.
parent | the parent node |
---|---|
child | the child to find the previous sibling of |
Finds the first node of the specified type in the chain of children.
parent | The parent |
---|---|
type | The type to find. |
Method to generate a map of token type names, keyed by their token type values.
tokenTypeInterface | The *TokenTypes interface (or implementor of said interface). |
---|
This method is deprecated.
Use #getTokenTypeName instead
Get the name of a constant defined on the given class which has the given value.
Note, if multiple constants have this value, the first will be returned which is known to be different on different JVM implementations.owner | The class which defines the constant |
---|---|
value | The value of the constant. |
Returns the 'list' representation with some brackets around it for debugging.
n | The tree. |
---|
Returns the last direct child of 'n'.
n | The parent |
---|
Intended to retrieve the name of an AST token type based on the token type interface. However, this method can be used to look up the name of any constant defined on a class/interface based on the constant value. Note that if multiple constants have this value, the first will be returned which is known to be different on different JVM implementations.
tokenTypeInterface | The *TokenTypes interface (or one of its implementors). |
---|---|
tokenType | The token type value. |
Inserts the child as the first child of the parent, all other children are shifted over to the 'right'.
parent | the parent |
---|---|
child | the new first child |
Inserts a node into a child subtree as a particularly positioned sibling taking care to properly reorganize the tree to account for this new addition.
node | The node to insert |
---|---|
prevSibling | The previous node at the sibling position where we want this node inserted. |
Determine if a given node (test) is contained anywhere in the subtree of another given node (fixture).
fixture | The node against which to testto be checked for children. |
---|---|
test | The node to be tested as being a subtree child of the parent. |
Makes the child node a sibling of the parent, reconnecting all siblings.
parent | the parent |
---|---|
child | the child |