Package org.apache.maven.index.treeview
Class AbstractTreeNode
- java.lang.Object
-
- org.apache.maven.index.treeview.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
-
Nested classes/interfaces inherited from interface org.apache.maven.index.treeview.TreeNode
TreeNode.Type
-
-
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.
-
Constructor Summary
Constructors Constructor Description AbstractTreeNode(IndexTreeView tview, TreeViewRequest request)
Constructor that takes an IndexTreeView implementation and a TreeNodeFactory implementation;
-
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.
-
-
-
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.
-
treeView
private final transient IndexTreeView treeView
-
request
private final transient TreeViewRequest request
-
-
Constructor Detail
-
AbstractTreeNode
public AbstractTreeNode(IndexTreeView tview, TreeViewRequest request)
Constructor that takes an IndexTreeView implementation and a TreeNodeFactory implementation;- Parameters:
tview
-factory
-
-
-
Method Detail
-
getType
public TreeNode.Type getType()
Get the type of node.
-
setType
public void setType(TreeNode.Type type)
Set the type of node.
-
isLeaf
public boolean isLeaf()
Get flag that determines if the node is a leaf.
-
setLeaf
public void setLeaf(boolean leaf)
Set flag that determines if the node is a leaf.
-
getNodeName
public java.lang.String getNodeName()
Get the name of the node.- Specified by:
getNodeName
in interfaceTreeNode
- Returns:
- String
-
setNodeName
public void setNodeName(java.lang.String nodeName)
Set the name of the node.- Specified by:
setNodeName
in interfaceTreeNode
- Parameters:
String
-
-
getPath
public java.lang.String getPath()
Get the path of the node.
-
setPath
public void setPath(java.lang.String path)
Set the path of the node.
-
getGroupId
public java.lang.String getGroupId()
Get the group id of this node.- Specified by:
getGroupId
in interfaceTreeNode
- Returns:
- String
-
setGroupId
public void setGroupId(java.lang.String groupId)
Set the group id of this node.- Specified by:
setGroupId
in interfaceTreeNode
- Parameters:
String
-
-
getArtifactId
public java.lang.String getArtifactId()
Get the artifact id of this node.- Specified by:
getArtifactId
in interfaceTreeNode
- Returns:
- String
-
setArtifactId
public void setArtifactId(java.lang.String artifactId)
Set the artifact id of this node.- Specified by:
setArtifactId
in interfaceTreeNode
- Parameters:
String
-
-
getVersion
public java.lang.String getVersion()
Get the version of this node.- Specified by:
getVersion
in interfaceTreeNode
- Returns:
- String
-
setVersion
public void setVersion(java.lang.String version)
Set the version of this node.- Specified by:
setVersion
in interfaceTreeNode
- Parameters:
String
-
-
getRepositoryId
public java.lang.String getRepositoryId()
Get the repository id that this node is stored in.- Specified by:
getRepositoryId
in interfaceTreeNode
- Returns:
- String
-
setRepositoryId
public void setRepositoryId(java.lang.String repositoryId)
Set the repository id that this node is stored in.- Specified by:
setRepositoryId
in interfaceTreeNode
- 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 interfaceTreeNode
- 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 interfaceTreeNode
- 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 interfaceTreeNode
- Returns:
- TreeNode
- Throws:
java.io.IOException
-
-