Class AbstractTreeNode

  • All Implemented Interfaces:
    TreeNode
    Direct Known Subclasses:
    DefaultTreeNode

    public abstract class AbstractTreeNode
    extends java.lang.Object
    implements TreeNode
    Base set of functionality for the TreeNode that all implementations will need.
    • Nested Class Summary

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.lang.String artifactId
      The artifact id of this node.
      private java.util.List<TreeNode> children
      The children of this node.
      private java.lang.String groupId
      The group id of this node.
      private boolean leaf
      Flag that determines if the node is a leaf.
      private java.lang.String nodeName
      The name of the node.
      private java.lang.String path
      The path of the node.
      private java.lang.String repositoryId
      The repository id that this node is stored in.
      private TreeViewRequest request  
      private IndexTreeView treeView  
      private java.lang.String type
      The type of node.
      private java.lang.String version
      The version of this node.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      TreeNode findChildByPath​(java.lang.String path, TreeNode.Type type)
      Find a TreeNode based upon a path and Type check.
      java.lang.String getArtifactId()
      Get the artifact id of this node.
      java.util.List<TreeNode> getChildren()
      Get the children of this node.
      java.lang.String getGroupId()
      Get the group id of this node.
      java.lang.String getNodeName()
      Get the name of the node.
      java.lang.String getPath()
      Get the path of the node.
      java.lang.String getRepositoryId()
      Get the repository id that this node is stored in.
      TreeNode.Type getType()
      Get the type of node.
      java.lang.String getVersion()
      Get the version of this node.
      boolean isLeaf()
      Get flag that determines if the node is a leaf.
      java.util.List<TreeNode> listChildren()
      Get the children of this node.
      void setArtifactId​(java.lang.String artifactId)
      Set the artifact id of this node.
      void setGroupId​(java.lang.String groupId)
      Set the group id of this node.
      void setLeaf​(boolean leaf)
      Set flag that determines if the node is a leaf.
      void setNodeName​(java.lang.String nodeName)
      Set the name of the node.
      void setPath​(java.lang.String path)
      Set the path of the node.
      void setRepositoryId​(java.lang.String repositoryId)
      Set the repository id that this node is stored in.
      void setType​(TreeNode.Type type)
      Set the type of node.
      void setVersion​(java.lang.String version)
      Set the version of this node.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • type

        private java.lang.String type
        The type of node.
      • leaf

        private boolean leaf
        Flag that determines if the node is a leaf.
      • nodeName

        private java.lang.String nodeName
        The name of the node.
      • path

        private java.lang.String path
        The path of the node.
      • children

        private java.util.List<TreeNode> children
        The children of this node.
      • groupId

        private java.lang.String groupId
        The group id of this node.
      • artifactId

        private java.lang.String artifactId
        The artifact id of this node.
      • version

        private java.lang.String version
        The version of this node.
      • repositoryId

        private java.lang.String repositoryId
        The repository id that this node is stored in.
    • Constructor Detail

      • AbstractTreeNode

        public AbstractTreeNode​(IndexTreeView tview,
                                TreeViewRequest request)
        Constructor that takes an IndexTreeView implementation and a TreeNodeFactory implementation;
        Parameters:
        tview -
        factory -
    • Method Detail

      • setType

        public void setType​(TreeNode.Type type)
        Set the type of node.
        Specified by:
        setType in interface TreeNode
        Parameters:
        Type -
      • isLeaf

        public boolean isLeaf()
        Get flag that determines if the node is a leaf.
        Specified by:
        isLeaf in interface TreeNode
        Returns:
        boolean
      • setLeaf

        public void setLeaf​(boolean leaf)
        Set flag that determines if the node is a leaf.
        Specified by:
        setLeaf in interface TreeNode
        Parameters:
        boolean -
      • getNodeName

        public java.lang.String getNodeName()
        Get the name of the node.
        Specified by:
        getNodeName in interface TreeNode
        Returns:
        String
      • setNodeName

        public void setNodeName​(java.lang.String nodeName)
        Set the name of the node.
        Specified by:
        setNodeName in interface TreeNode
        Parameters:
        String -
      • getPath

        public java.lang.String getPath()
        Get the path of the node.
        Specified by:
        getPath in interface TreeNode
        Returns:
        String
      • setPath

        public void setPath​(java.lang.String path)
        Set the path of the node.
        Specified by:
        setPath in interface TreeNode
        Parameters:
        String -
      • getGroupId

        public java.lang.String getGroupId()
        Get the group id of this node.
        Specified by:
        getGroupId in interface TreeNode
        Returns:
        String
      • setGroupId

        public void setGroupId​(java.lang.String groupId)
        Set the group id of this node.
        Specified by:
        setGroupId in interface TreeNode
        Parameters:
        String -
      • getArtifactId

        public java.lang.String getArtifactId()
        Get the artifact id of this node.
        Specified by:
        getArtifactId in interface TreeNode
        Returns:
        String
      • setArtifactId

        public void setArtifactId​(java.lang.String artifactId)
        Set the artifact id of this node.
        Specified by:
        setArtifactId in interface TreeNode
        Parameters:
        String -
      • getVersion

        public java.lang.String getVersion()
        Get the version of this node.
        Specified by:
        getVersion in interface TreeNode
        Returns:
        String
      • setVersion

        public void setVersion​(java.lang.String version)
        Set the version of this node.
        Specified by:
        setVersion in interface TreeNode
        Parameters:
        String -
      • getRepositoryId

        public java.lang.String getRepositoryId()
        Get the repository id that this node is stored in.
        Specified by:
        getRepositoryId in interface TreeNode
        Returns:
        String
      • setRepositoryId

        public void setRepositoryId​(java.lang.String repositoryId)
        Set the repository id that this node is stored in.
        Specified by:
        setRepositoryId in interface TreeNode
        Parameters:
        String -
      • getChildren

        public java.util.List<TreeNode> getChildren()
        Get the children of this node. If this is a leaf node, null will be returned. This will NOT perform any actions on the index to retrieve the children, will only return children that have already been loaded via the listChildren method.
        Specified by:
        getChildren in interface TreeNode
        Returns:
        List
      • listChildren

        public java.util.List<TreeNode> listChildren()
                                              throws java.io.IOException
        Get the children of this node. If this is a leaf node, null will be returned. This will use the index to retrieve the list of child nodes.
        Specified by:
        listChildren in interface TreeNode
        Returns:
        List
        Throws:
        java.io.IOException
      • findChildByPath

        public TreeNode findChildByPath​(java.lang.String path,
                                        TreeNode.Type type)
                                 throws java.io.IOException
        Find a TreeNode based upon a path and Type check.
        Specified by:
        findChildByPath in interface TreeNode
        Returns:
        TreeNode
        Throws:
        java.io.IOException