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.StringartifactIdThe artifact id of this node.private java.util.List<TreeNode>childrenThe children of this node.private java.lang.StringgroupIdThe group id of this node.private booleanleafFlag that determines if the node is a leaf.private java.lang.StringnodeNameThe name of the node.private java.lang.StringpathThe path of the node.private java.lang.StringrepositoryIdThe repository id that this node is stored in.private TreeViewRequestrequestprivate IndexTreeViewtreeViewprivate java.lang.StringtypeThe type of node.private java.lang.StringversionThe 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 TreeNodefindChildByPath(java.lang.String path, TreeNode.Type type)Find a TreeNode based upon a path and Type check.java.lang.StringgetArtifactId()Get the artifact id of this node.java.util.List<TreeNode>getChildren()Get the children of this node.java.lang.StringgetGroupId()Get the group id of this node.java.lang.StringgetNodeName()Get the name of the node.java.lang.StringgetPath()Get the path of the node.java.lang.StringgetRepositoryId()Get the repository id that this node is stored in.TreeNode.TypegetType()Get the type of node.java.lang.StringgetVersion()Get the version of this node.booleanisLeaf()Get flag that determines if the node is a leaf.java.util.List<TreeNode>listChildren()Get the children of this node.voidsetArtifactId(java.lang.String artifactId)Set the artifact id of this node.voidsetGroupId(java.lang.String groupId)Set the group id of this node.voidsetLeaf(boolean leaf)Set flag that determines if the node is a leaf.voidsetNodeName(java.lang.String nodeName)Set the name of the node.voidsetPath(java.lang.String path)Set the path of the node.voidsetRepositoryId(java.lang.String repositoryId)Set the repository id that this node is stored in.voidsetType(TreeNode.Type type)Set the type of node.voidsetVersion(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:
getNodeNamein interfaceTreeNode- Returns:
- String
-
setNodeName
public void setNodeName(java.lang.String nodeName)
Set the name of the node.- Specified by:
setNodeNamein 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:
getGroupIdin interfaceTreeNode- Returns:
- String
-
setGroupId
public void setGroupId(java.lang.String groupId)
Set the group id of this node.- Specified by:
setGroupIdin interfaceTreeNode- Parameters:
String-
-
getArtifactId
public java.lang.String getArtifactId()
Get the artifact id of this node.- Specified by:
getArtifactIdin interfaceTreeNode- Returns:
- String
-
setArtifactId
public void setArtifactId(java.lang.String artifactId)
Set the artifact id of this node.- Specified by:
setArtifactIdin interfaceTreeNode- Parameters:
String-
-
getVersion
public java.lang.String getVersion()
Get the version of this node.- Specified by:
getVersionin interfaceTreeNode- Returns:
- String
-
setVersion
public void setVersion(java.lang.String version)
Set the version of this node.- Specified by:
setVersionin interfaceTreeNode- Parameters:
String-
-
getRepositoryId
public java.lang.String getRepositoryId()
Get the repository id that this node is stored in.- Specified by:
getRepositoryIdin interfaceTreeNode- Returns:
- String
-
setRepositoryId
public void setRepositoryId(java.lang.String repositoryId)
Set the repository id that this node is stored in.- Specified by:
setRepositoryIdin 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:
getChildrenin 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:
listChildrenin 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:
findChildByPathin interfaceTreeNode- Returns:
- TreeNode
- Throws:
java.io.IOException
-
-