org.apache.maven.index.treeview
Class AbstractTreeNode

java.lang.Object
  extended by 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.


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.apache.maven.index.treeview.TreeNode
TreeNode.Type
 
Constructor Summary
AbstractTreeNode(IndexTreeView tview, TreeViewRequest request)
          Constructor that takes an IndexTreeView implementation and a TreeNodeFactory implementation;
 
Method Summary
 TreeNode findChildByPath(String path, TreeNode.Type type)
          Find a TreeNode based upon a path and Type check.
 String getArtifactId()
          Get the artifact id of this node.
 List<TreeNode> getChildren()
          Get the children of this node.
 String getGroupId()
          Get the group id of this node.
 String getNodeName()
          Get the name of the node.
 String getPath()
          Get the path of the node.
 String getRepositoryId()
          Get the repository id that this node is stored in.
 TreeNode.Type getType()
          Get the type of node.
 String getVersion()
          Get the version of this node.
 boolean isLeaf()
          Get flag that determines if the node is a leaf.
 List<TreeNode> listChildren()
          Get the children of this node.
 void setArtifactId(String artifactId)
          Set the artifact id of this node.
 void setGroupId(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(String nodeName)
          Set the name of the node.
 void setPath(String path)
          Set the path of the node.
 void setRepositoryId(String repositoryId)
          Set the repository id that this node is stored in.
 void setType(TreeNode.Type type)
          Set the type of node.
 void setVersion(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
 

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.

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:
boolean -

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:
String -

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:
String -

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:
String -

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:
String -

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:
String -

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:
String -

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


Copyright © 2002-2012 The Apache Software Foundation. All Rights Reserved.