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 Object
INTERNALPurpose: 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 Expression
addToExpression(Expression parentExpression, GenerationContext context)
INTERNAL Add my expression semantics to the parentExpression.Expression
appendExpression(Expression left, Expression right)
INTERNAL Returns left.and(right) if both are defined.void
applyToQuery(ObjectLevelReadQuery theQuery, GenerationContext context)
INTERNAL Apply this node to the passed queryExpression
generateExpression(GenerationContext context)
INTERNAL Generate an expression for the node.String
getAlias()
String
getAsString()
INTERNAL Get the string representation of this node.int
getColumn()
Node
getLeft()
INTERNAL Return the left nodeint
getLine()
Node
getRight()
INTERNAL Return the right nodeObject
getType()
INTERNAL Return the type of this node.boolean
hasLeft()
INTERNAL Does this node have a leftboolean
hasRight()
INTERNAL Does this node have a rightboolean
isAggregateNode()
INTERNAL Is this node an Aggregate nodeboolean
isAliasableNode()
boolean
isAttributeNode()
INTERNAL Is this node an AttributeNodeboolean
isConstructorNode()
INTERNAL Is this node a ConstructorNodeboolean
isCountNode()
INTERNAL Is this node a CountNodeboolean
isDivideNode()
INTERNAL Is this node a Divide nodeboolean
isDotNode()
INTERNAL Is this node a Dot nodeboolean
isEscape()
INTERNAL Is this an escape nodeboolean
isLiteralNode()
INTERNAL Is this a literal nodeboolean
isMapKeyNode()
INTERNAL Is this node a MapKey nodeboolean
isMinusNode()
INTERNAL Is this node a Minus nodeboolean
isMultiplyNode()
INTERNAL Is this node a Multiply nodeboolean
isNotNode()
INTERNAL Is this node a Not nodeboolean
isParameterNode()
INTERNAL Is this a Parameter nodeboolean
isPlusNode()
INTERNAL Is this node a Plus nodeboolean
isSubqueryNode()
INTERNAL Is this node a SubqueryNodeboolean
isVariableNode()
INTERNAL Is this node a VariableNodeNode
qualifyAttributeAccess(ParseTreeContext context)
INTERNAL Check the child node for an unqualified field access and if so, replace it by a qualified field access.String
resolveAttribute()
resolveAttribute(): Answer the name of the attribute which is represented by the receiver.Class
resolveClass(GenerationContext context)
resolveClass: Answer the class associated with the content of this node.Class
resolveClass(GenerationContext context, Class ownerClass)
resolveClass: Answer the class associated with the content of this node.DatabaseMapping
resolveMapping(GenerationContext context)
resolveMapping: Answer the mapping associated with the contained nodes.DatabaseMapping
resolveMapping(GenerationContext context, Class ownerClass)
resolveMapping: Answer the mapping associated with the contained nodes.void
setAlias(String alias)
void
setColumn(int column)
void
setLeft(Node newLeft)
INTERNAL Set the left node to the passed valuevoid
setLine(int line)
void
setRight(Node newRight)
INTERNAL Set the right for this nodevoid
setType(Object type)
INTERNAL Set this node's type.String
toString()
String
toString(int indent)
String
toStringDisplayName()
void
toStringIndent(int indent, StringBuilder buffer)
void
validate(ParseTreeContext context)
INTERNAL Validate node and calculate its type.void
validateParameter(ParseTreeContext context, 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 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, 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 String resolveAttribute()
resolveAttribute(): Answer the name of the attribute which is represented by the receiver. Subclasses should override this.
-
resolveClass
public 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 Class resolveClass(GenerationContext context, 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, 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 Object getType()
INTERNAL Return the type of this node.
-
setType
public void setType(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 String toString(int indent)
-
toStringDisplayName
public String toStringDisplayName()
-
toStringIndent
public void toStringIndent(int indent, StringBuilder buffer)
-
getAlias
public String getAlias()
-
setAlias
public void setAlias(String alias)
-
isAliasableNode
public boolean isAliasableNode()
-
-