Class Node

  • Direct Known Subclasses:
    MetadataNode

    public class Node
    extends java.lang.Object
    Superclass of left and right nodes
    Author:
    Mark Woodbridge
    • Constructor Summary

      Constructors 
      Constructor Description
      Node​(java.lang.String type)
      Constructor for a root node
      Node​(Node parent, java.lang.String fieldName, boolean outer)
      Constructor for a non-root node.
    • Constructor Detail

      • Node

        public Node​(java.lang.String type)
        Constructor for a root node
        Parameters:
        type - the root type of this tree
      • Node

        public Node​(Node parent,
                    java.lang.String fieldName,
                    boolean outer)
        Constructor for a non-root node.
        Parameters:
        parent - the parent node of this node
        fieldName - the name of the field that this node represents
        outer - true if this node should be an outer join
    • Method Detail

      • setModel

        public void setModel​(Model model)
        Attach the model. Throws IllegalArgumentExceptions if node doesn't map onto the model.
        Parameters:
        model - model to attach
        Throws:
        java.lang.IllegalArgumentException - if class or field are not found in the model
      • getParentType

        public java.lang.String getParentType()
        Type of parent node. Required for MainController to find field value enumerations with fieldName and parentType.
        Returns:
        type of parent node
      • getMinimalPath

        public Path getMinimalPath()
        Returns:
        the minimal path that describes this node (just the parent type and its field)
      • getFieldDescriptor

        public FieldDescriptor getFieldDescriptor()
        Returns:
        The field descriptor of this node.
      • getParent

        public Node getParent()
        Get the parent node.
        Returns:
        the parent node
      • getPathString

        public java.lang.String getPathString()
        Gets the String value of pathString of this node (eg. "Department.manager.name")
        Returns:
        the String value of pathString
      • getOuterJoinGroup

        public java.lang.String getOuterJoinGroup()
        Returns a String describing the outer join group that this Node is in. Nodes in the same group can be constrained to one another, as they are fetched in the same query.
        Returns:
        a String
      • getOuterJoinGroup

        public static java.lang.String getOuterJoinGroup​(java.lang.String path)
        Returns a String describing the outer join group that the given path string is in.
        Parameters:
        path - the path string
        Returns:
        a String
      • getType

        public java.lang.String getType()
        Gets the value of type
        Returns:
        the value of type
      • setType

        public void setType​(java.lang.String type)
        Set the value of type
        Parameters:
        type - the value of type
      • getPrefix

        public java.lang.String getPrefix()
        Gets the value of prefix
        Returns:
        the value of prefix
      • getFieldName

        public java.lang.String getFieldName()
        Gets the value of fieldName
        Returns:
        the value of fieldName
      • getFriendlyName

        public java.lang.String getFriendlyName()
        Gets a friendly name for display on the web site.
        Returns:
        a String
      • isAttribute

        public boolean isAttribute()
        Gets the value of attribute
        Returns:
        the value of attribute
      • isReference

        public boolean isReference()
        Gets the value of reference
        Returns:
        the value of reference
      • isCollection

        public boolean isCollection()
        Gets the value of collection
        Returns:
        the value of collection
      • getIndentation

        public int getIndentation()
        Gets the value of indentation
        Returns:
        the value of indentation
      • isOuterJoin

        public boolean isOuterJoin()
        Returns true if this should be an outer join.
        Returns:
        a boolean
      • setOuterJoin

        public void setOuterJoin​(boolean outer)
        Sets whether this should be an outer join.
        Parameters:
        outer - a boolean
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object