Class AbstractTreeNode

java.lang.Object
org.apache.maven.index.treeview.AbstractTreeNode
All Implemented Interfaces:
TreeNode
Direct Known Subclasses:
DefaultTreeNode

public abstract class AbstractTreeNode extends Object implements TreeNode
Base set of functionality for the TreeNode that all implementations will need.
  • Constructor Details

    • AbstractTreeNode

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

    • getType

      public TreeNode.Type getType()
      Get the type of node.
      Specified by:
      getType in interface TreeNode
      Returns:
      Type
    • 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:
      leaf -
    • getNodeName

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

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

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

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

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

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

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

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

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

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

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

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

      public 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 List<TreeNode> listChildren() throws 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:
      IOException
    • findChildByPath

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