Class VariableNode

  • All Implemented Interfaces:
    AliasableNode

    public class VariableNode
    extends Node
    implements AliasableNode
    INTERNAL

    Purpose: The node that represents typed variables, local variables, remote variables and TYPE constants.

    Since:
    TopLink 4.0
    Author:
    Jon Driscoll and Joel Lucuik
    • Constructor Detail

      • VariableNode

        public VariableNode()
        VariableNode constructor comment.
      • VariableNode

        public VariableNode​(String newVariableName)
    • Method Detail

      • getVariableName

        public String getVariableName()
      • setVariableName

        public void setVariableName​(String newVariableName)
      • getCanonicalVariableName

        public String getCanonicalVariableName()
      • isVariableNode

        public boolean isVariableNode()
        INTERNAL Is this node a VariableNode
        Overrides:
        isVariableNode in class Node
      • qualifyAttributeAccess

        public Node qualifyAttributeAccess​(ParseTreeContext context)
        INTERNAL This node represent an unqualified field access in the case the method is called and the variableName is not defined as identification variable. The method returns a DotNode representing a qualified field access with the base variable as left child node. The right child node is an AttributeNode using the variableName as field name.
        Overrides:
        qualifyAttributeAccess in class Node
      • validate

        public void validate​(ParseTreeContext context)
        INTERNAL Validate node and calculate its type.
        Overrides:
        validate in class Node
      • generateExpression

        public Expression generateExpression​(GenerationContext generationContext)
        Description copied from class: Node
        INTERNAL Generate an expression for the node. Each subclass will generate a different expression and thus will need to override this method
        Overrides:
        generateExpression in class Node
      • isAlias

        public boolean isAlias​(GenerationContext context)
        isAlias: Answer true if this variable represents an alias in the FROM clause. i.e. "FROM Employee emp" declares "emp" as an alias
      • resolveClass

        public Class resolveClass​(GenerationContext generationContext)
        resolveClass: Answer the class which corresponds to my variableName. This is the class for an alias, where the variableName is registered to an alias.
        Overrides:
        resolveClass in class Node
      • getAsString

        public String getAsString()
        INTERNAL Get the string representation of this node.
        Overrides:
        getAsString in class Node
      • isAliasableNode

        public boolean isAliasableNode()
        Overrides:
        isAliasableNode in class Node