Package org.apache.cayenne.ejbql.parser
Class SimpleNode
- java.lang.Object
-
- org.apache.cayenne.ejbql.parser.SimpleNode
-
- All Implemented Interfaces:
Serializable,EJBQLExpression,Node
- Direct Known Subclasses:
AggregateConditionNode,EJBQLAbs,EJBQLAbstractSchemaName,EJBQLAdd,EJBQLAggregate,EJBQLAggregateColumn,EJBQLAll,EJBQLAny,EJBQLAscending,EJBQLBetween,EJBQLBooleanLiteral,EJBQLClassName,EJBQLConcat,EJBQLConstructor,EJBQLConstructorParameter,EJBQLConstructorParameters,EJBQLCurrentDate,EJBQLCurrentTime,EJBQLCurrentTimestamp,EJBQLDecimalLiteral,EJBQLDelete,EJBQLDescending,EJBQLDistinct,EJBQLDivide,EJBQLEquals,EJBQLEscapeCharacter,EJBQLExists,EJBQLFrom,EJBQLFromItem,EJBQLGreaterOrEqual,EJBQLGreaterThan,EJBQLGroupBy,EJBQLHaving,EJBQLIdentificationVariable,EJBQLIdentifier,EJBQLIn,EJBQLIntegerLiteral,EJBQLIsEmpty,EJBQLIsNull,EJBQLJoin,EJBQLLength,EJBQLLessOrEqual,EJBQLLessThan,EJBQLLike,EJBQLLocate,EJBQLLower,EJBQLMemberOf,EJBQLMod,EJBQLMultiply,EJBQLNamedInputParameter,EJBQLNegative,EJBQLNotEquals,EJBQLOrderBy,EJBQLOrderByItem,EJBQLPath,EJBQLPatternValue,EJBQLPositionalInputParameter,EJBQLSelect,EJBQLSelectClause,EJBQLSelectExpression,EJBQLSelectExpressions,EJBQLSize,EJBQLSqrt,EJBQLStringLiteral,EJBQLSubselect,EJBQLSubstring,EJBQLSubtract,EJBQLTok,EJBQLTrim,EJBQLTrimCharacter,EJBQLTrimSpecification,EJBQLUpdate,EJBQLUpdateField,EJBQLUpdateItem,EJBQLUpdateValue,EJBQLUpper,EJBQLWhere
public abstract class SimpleNode extends Object implements Node, Serializable, EJBQLExpression
A base node for the EJBQL concrete nodes that satisfies JJTree requirements.- Since:
- 3.0
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description SimpleNode(int id)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description EJBQLExpressiongetChild(int index)Returns a child expression node at the specified index.intgetChildrenCount()Returns a number of child operands of this expression node.StringgetName()StringgetText()Returns a text property of the node.booleanisNegated()Returns an optional boolean flag that negates the value of the expression.voidjjtAddChild(Node n, int i)This method tells the node to add its argument to the node's list of children.voidjjtClose()This method is called after all the child nodes have been added.NodejjtGetChild(int i)This method returns a child node.intjjtGetNumChildren()Return the number of children the node has.NodejjtGetParent()voidjjtOpen()This method is called after the node has been made the current node.voidjjtSetParent(Node parent)This pair of methods are used to inform the node of its parent.voidsetText(String text)StringtoString()voidvisit(EJBQLExpressionVisitor visitor)A recursive visit method that passes a visitor to this node and all its children, depth first.protected booleanvisitChild(EJBQLExpressionVisitor visitor, int childIndex)Recursively visits a child at the specified index.protected booleanvisitNode(EJBQLExpressionVisitor visitor)Visits this node without recursion.
-
-
-
Method Detail
-
getText
public String getText()
Description copied from interface:EJBQLExpressionReturns a text property of the node.- Specified by:
getTextin interfaceEJBQLExpression
-
isNegated
public boolean isNegated()
Description copied from interface:EJBQLExpressionReturns an optional boolean flag that negates the value of the expression.- Specified by:
isNegatedin interfaceEJBQLExpression
-
visit
public void visit(EJBQLExpressionVisitor visitor)
A recursive visit method that passes a visitor to this node and all its children, depth first.- Specified by:
visitin interfaceEJBQLExpression
-
visitNode
protected boolean visitNode(EJBQLExpressionVisitor visitor)
Visits this node without recursion. Default implementation simply returns true. Subclasses override this method to call an appropriate visitor method.
-
visitChild
protected boolean visitChild(EJBQLExpressionVisitor visitor, int childIndex)
Recursively visits a child at the specified index. Subclasses override this method if they desire to implement callbacks after visiting each child.
-
getChild
public EJBQLExpression getChild(int index)
Description copied from interface:EJBQLExpressionReturns a child expression node at the specified index.- Specified by:
getChildin interfaceEJBQLExpression
-
getChildrenCount
public int getChildrenCount()
Description copied from interface:EJBQLExpressionReturns a number of child operands of this expression node.- Specified by:
getChildrenCountin interfaceEJBQLExpression
-
getName
public String getName()
-
jjtOpen
public void jjtOpen()
Description copied from interface:NodeThis method is called after the node has been made the current node. It indicates that child nodes can now be added to it.
-
jjtClose
public void jjtClose()
Description copied from interface:NodeThis method is called after all the child nodes have been added.
-
jjtSetParent
public void jjtSetParent(Node parent)
Description copied from interface:NodeThis pair of methods are used to inform the node of its parent.- Specified by:
jjtSetParentin interfaceNode
-
jjtGetParent
public Node jjtGetParent()
- Specified by:
jjtGetParentin interfaceNode
-
jjtAddChild
public void jjtAddChild(Node n, int i)
Description copied from interface:NodeThis method tells the node to add its argument to the node's list of children.- Specified by:
jjtAddChildin interfaceNode
-
jjtGetChild
public Node jjtGetChild(int i)
Description copied from interface:NodeThis method returns a child node. The children are numbered from zero, left to right.- Specified by:
jjtGetChildin interfaceNode
-
jjtGetNumChildren
public int jjtGetNumChildren()
Description copied from interface:NodeReturn the number of children the node has.- Specified by:
jjtGetNumChildrenin interfaceNode
-
setText
public void setText(String text)
-
-