Class MetadataNode


  • public class MetadataNode
    extends Node
    Node used in displaying metadata
    Author:
    Mark Woodbridge
    • Constructor Detail

      • MetadataNode

        public MetadataNode​(java.lang.String type,
                            java.util.List<java.lang.String> structure,
                            PathQuery query,
                            java.util.Map<java.lang.String,​java.util.List<FieldDescriptor>> classKeys,
                            BagManager bagManager,
                            Profile profile)
        Constructor for a root node
        Parameters:
        type - the root type of this tree
        structure - a List of Strings - for definition, see getStructure()
        query - a PathQuery, for working out possible loops
        classKeys - a Map of class keys, for working out if a path has any
        bagManager - a BagManager object, for working out if it is possible to constrain by bag
        profile - the profile of the current user, for fetching bags from the BagManager
      • MetadataNode

        public MetadataNode​(MetadataNode parent,
                            java.lang.String fieldName,
                            java.lang.String button,
                            java.util.List<java.lang.String> structure,
                            PathQuery query,
                            java.util.Map<java.lang.String,​java.util.List<FieldDescriptor>> classKeys,
                            BagManager bagManager,
                            Profile profile,
                            java.lang.Boolean isNull)
        Constructor for a non-root node
        Parameters:
        parent - the parent node of this node
        fieldName - the name of the field that this node represents
        button - the button displayed next to this node's name
        structure - a List of Strings - for definition, see getStructure()
        query - a PathQuery, for working out possible loops
        classKeys - a Map of class keys, for working out if a path has any
        bagManager - a BagManager object, for working out if it is possible to constrain by bag
        profile - the profile of the current user, for fetching bags from the BagManager
        isNull - is the field null or empty? (OS-Summary determined)
    • Method Detail

      • setModel

        public void setModel​(Model model)
        Description copied from class: Node
        Attach the model. Throws IllegalArgumentExceptions if node doesn't map onto the model.
        Overrides:
        setModel in class Node
        Parameters:
        model - model to attach
      • setType

        public void setType​(java.lang.String type)
        Set the value of type
        Overrides:
        setType in class Node
        Parameters:
        type - the value of type
      • getButton

        public java.lang.String getButton()
        Gets the value of button
        Returns:
        the value of button
      • isSelected

        public boolean isSelected()
        Get the value of selected
        Returns:
        the value of selected as a boolean
      • setSelected

        public void setSelected​(boolean selected)
        Sets the value of selected
        Parameters:
        selected - a boolean
      • getStructure

        public java.util.List<java.lang.String> getStructure()
        Returns the structure of the tree. This is an array of Strings, which are one of four possible strings, in order to draw a tree structure:
        • blank - Do not draw any lines.
        • straight - Draw a straight vertical line.
        • ell - Draw an L-shaped line.
        • tee - Draw a T-junction, with lines going vertically and to the right.
        If the sequence of these is correctly drawn in front of each tree node, then a tree structure will be drawn correctly.
        Returns:
        a List of Strings
      • getOrigType

        public java.lang.String getOrigType()
        Returns the type of this node if it did not have a subclass constraint.
        Returns:
        a String type name
      • getHasSubclasses

        public boolean getHasSubclasses()
        Returns true if the original type has subclasses in the model.
        Returns:
        a boolean
      • isReverseReference

        public boolean isReverseReference()
        Returns true if this path is a reverse reference back onto the previous node.
        Returns:
        a boolean
      • getHasPossibleLoops

        public boolean getHasPossibleLoops()
                                    throws PathException
        Returns true if this path in the query has possible loop constraints that are not already in the query.
        Returns:
        a boolean
        Throws:
        PathException - if the query is invalid
      • getHasClassKeys

        public boolean getHasClassKeys()
        Returns true if the type of this path has class keys configured.
        Returns:
        a boolean
      • getHasAvailableBags

        public boolean getHasAvailableBags()
        Returns true if there are any available bags for the type of this path.
        Returns:
        a boolean
      • getCanCreateConstraint

        public boolean getCanCreateConstraint()
                                       throws PathException
        Returns true if there is any possibility of creating a constraint on this path.
        Returns:
        a boolean
        Throws:
        PathException - if the query is invalid
      • getIsNull

        public boolean getIsNull()
        Returns:
        a boolean is this Node is null or empty as determined by OSS
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class Node