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
INTERNAL

Purpose: 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
  • Field Details

    • left

      protected Node left
    • shouldGenerateExpression

      public boolean shouldGenerateExpression
    • alias

      protected String alias
  • Constructor Details

    • Node

      public Node()
      Return a new Node.
  • Method Details

    • 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()
      Overrides:
      toString in class Object
    • 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()