Class Node
- java.lang.Object
-
- org.eclipse.persistence.internal.jpa.parsing.Node
-
- Direct Known Subclasses:
AggregateNode,AllNode,AnyNode,AttributeNode,BinaryOperatorNode,CaseNode,ClassForInheritanceNode,CoalesceNode,ConstructorNode,ExistsNode,FetchJoinNode,FunctionalExpressionNode,IdentificationVariableDeclNode,IndexNode,LiteralNode,LogicalOperatorNode,MajorNode,MapEntryNode,MapKeyNode,NullIfNode,OrderByItemNode,ParameterNode,SimpleConditionalExpressionNode,SomeNode,SortDirectionNode,SubqueryNode,UnaryMinus,VariableNode,WhenThenNode
public class Node extends java.lang.ObjectINTERNALPurpose: This is the superclass for all Nodes.
Responsibilities:
- Answer default answers for all method calls
- Delegate most responsibilities to the sub-classes
- Since:
- TopLink 4.0
- Author:
- Jon Driscoll and Joel Lucuik
-
-
Constructor Summary
Constructors Constructor Description Node()Return a new Node.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ExpressionaddToExpression(Expression parentExpression, GenerationContext context)INTERNAL Add my expression semantics to the parentExpression.ExpressionappendExpression(Expression left, Expression right)INTERNAL Returns left.and(right) if both are defined.voidapplyToQuery(ObjectLevelReadQuery theQuery, GenerationContext context)INTERNAL Apply this node to the passed queryExpressiongenerateExpression(GenerationContext context)INTERNAL Generate an expression for the node.java.lang.StringgetAlias()java.lang.StringgetAsString()INTERNAL Get the string representation of this node.intgetColumn()NodegetLeft()INTERNAL Return the left nodeintgetLine()NodegetRight()INTERNAL Return the right nodejava.lang.ObjectgetType()INTERNAL Return the type of this node.booleanhasLeft()INTERNAL Does this node have a leftbooleanhasRight()INTERNAL Does this node have a rightbooleanisAggregateNode()INTERNAL Is this node an Aggregate nodebooleanisAliasableNode()booleanisAttributeNode()INTERNAL Is this node an AttributeNodebooleanisConstructorNode()INTERNAL Is this node a ConstructorNodebooleanisCountNode()INTERNAL Is this node a CountNodebooleanisDivideNode()INTERNAL Is this node a Divide nodebooleanisDotNode()INTERNAL Is this node a Dot nodebooleanisEscape()INTERNAL Is this an escape nodebooleanisLiteralNode()INTERNAL Is this a literal nodebooleanisMapKeyNode()INTERNAL Is this node a MapKey nodebooleanisMinusNode()INTERNAL Is this node a Minus nodebooleanisMultiplyNode()INTERNAL Is this node a Multiply nodebooleanisNotNode()INTERNAL Is this node a Not nodebooleanisParameterNode()INTERNAL Is this a Parameter nodebooleanisPlusNode()INTERNAL Is this node a Plus nodebooleanisSubqueryNode()INTERNAL Is this node a SubqueryNodebooleanisVariableNode()INTERNAL Is this node a VariableNodeNodequalifyAttributeAccess(ParseTreeContext context)INTERNAL Check the child node for an unqualified field access and if so, replace it by a qualified field access.java.lang.StringresolveAttribute()resolveAttribute(): Answer the name of the attribute which is represented by the receiver.java.lang.ClassresolveClass(GenerationContext context)resolveClass: Answer the class associated with the content of this node.java.lang.ClassresolveClass(GenerationContext context, java.lang.Class ownerClass)resolveClass: Answer the class associated with the content of this node.DatabaseMappingresolveMapping(GenerationContext context)resolveMapping: Answer the mapping associated with the contained nodes.DatabaseMappingresolveMapping(GenerationContext context, java.lang.Class ownerClass)resolveMapping: Answer the mapping associated with the contained nodes.voidsetAlias(java.lang.String alias)voidsetColumn(int column)voidsetLeft(Node newLeft)INTERNAL Set the left node to the passed valuevoidsetLine(int line)voidsetRight(Node newRight)INTERNAL Set the right for this nodevoidsetType(java.lang.Object type)INTERNAL Set this node's type.java.lang.StringtoString()java.lang.StringtoString(int indent)java.lang.StringtoStringDisplayName()voidtoStringIndent(int indent, java.lang.StringBuilder buffer)voidvalidate(ParseTreeContext context)INTERNAL Validate node and calculate its type.voidvalidateParameter(ParseTreeContext context, java.lang.Object contextType)INTERNAL
-
-
-
Method Detail
-
applyToQuery
public void applyToQuery(ObjectLevelReadQuery theQuery, GenerationContext context)
INTERNAL Apply this node to the passed query
-
addToExpression
public Expression addToExpression(Expression parentExpression, GenerationContext context)
INTERNAL Add my expression semantics to the parentExpression. Each subclass will add a different expression and thus will need to override this method
-
getAsString
public java.lang.String getAsString()
INTERNAL Get the string representation of this node. By default return toString()
-
qualifyAttributeAccess
public Node qualifyAttributeAccess(ParseTreeContext context)
INTERNAL Check the child node for an unqualified field access and if so, replace it by a qualified field access.
-
validate
public void validate(ParseTreeContext context)
INTERNAL Validate node and calculate its type.
-
validateParameter
public void validateParameter(ParseTreeContext context, java.lang.Object contextType)
INTERNAL
-
generateExpression
public Expression generateExpression(GenerationContext context)
INTERNAL Generate an expression for the node. Each subclass will generate a different expression and thus will need to override this method
-
getLeft
public Node getLeft()
INTERNAL Return the left node
-
getRight
public Node getRight()
INTERNAL Return the right node
-
hasLeft
public boolean hasLeft()
INTERNAL Does this node have a left
-
hasRight
public boolean hasRight()
INTERNAL Does this node have a right
-
isAggregateNode
public boolean isAggregateNode()
INTERNAL Is this node an Aggregate node
-
isDotNode
public boolean isDotNode()
INTERNAL Is this node a Dot node
-
isLiteralNode
public boolean isLiteralNode()
INTERNAL Is this a literal node
-
isMultiplyNode
public boolean isMultiplyNode()
INTERNAL Is this node a Multiply node
-
isNotNode
public boolean isNotNode()
INTERNAL Is this node a Not node
-
isParameterNode
public boolean isParameterNode()
INTERNAL Is this a Parameter node
-
isDivideNode
public boolean isDivideNode()
INTERNAL Is this node a Divide node
-
isPlusNode
public boolean isPlusNode()
INTERNAL Is this node a Plus node
-
isMapKeyNode
public boolean isMapKeyNode()
INTERNAL Is this node a MapKey node
-
isMinusNode
public boolean isMinusNode()
INTERNAL Is this node a Minus node
-
isVariableNode
public boolean isVariableNode()
INTERNAL Is this node a VariableNode
-
isAttributeNode
public boolean isAttributeNode()
INTERNAL Is this node an AttributeNode
-
isCountNode
public boolean isCountNode()
INTERNAL Is this node a CountNode
-
isConstructorNode
public boolean isConstructorNode()
INTERNAL Is this node a ConstructorNode
-
isSubqueryNode
public boolean isSubqueryNode()
INTERNAL Is this node a SubqueryNode
-
isEscape
public boolean isEscape()
INTERNAL Is this an escape node
-
resolveAttribute
public java.lang.String resolveAttribute()
resolveAttribute(): Answer the name of the attribute which is represented by the receiver. Subclasses should override this.
-
resolveClass
public java.lang.Class resolveClass(GenerationContext context)
resolveClass: Answer the class associated with the content of this node. Default is to return null. Subclasses should override this.
-
resolveClass
public java.lang.Class resolveClass(GenerationContext context, java.lang.Class ownerClass)
resolveClass: Answer the class associated with the content of this node. Default is to return null. Subclasses should override this.
-
resolveMapping
public DatabaseMapping resolveMapping(GenerationContext context)
resolveMapping: Answer the mapping associated with the contained nodes. Subclasses should override this.
-
resolveMapping
public DatabaseMapping resolveMapping(GenerationContext context, java.lang.Class ownerClass)
resolveMapping: Answer the mapping associated with the contained nodes. Use the provided class as the context. Subclasses should override this.
-
setLeft
public void setLeft(Node newLeft)
INTERNAL Set the left node to the passed value
-
setRight
public void setRight(Node newRight)
INTERNAL Set the right for this node
-
getLine
public int getLine()
-
setLine
public void setLine(int line)
-
getColumn
public int getColumn()
-
setColumn
public void setColumn(int column)
-
getType
public java.lang.Object getType()
INTERNAL Return the type of this node.
-
setType
public void setType(java.lang.Object type)
INTERNAL Set this node's type.
-
appendExpression
public Expression appendExpression(Expression left, Expression right)
INTERNAL Returns left.and(right) if both are defined.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
toString
public java.lang.String toString(int indent)
-
toStringDisplayName
public java.lang.String toStringDisplayName()
-
toStringIndent
public void toStringIndent(int indent, java.lang.StringBuilder buffer)
-
getAlias
public java.lang.String getAlias()
-
setAlias
public void setAlias(java.lang.String alias)
-
isAliasableNode
public boolean isAliasableNode()
-
-