Constructor and Description |
---|
TreeNodeImpl(TreeNode<T> parent,
T object,
String name)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
TreeNode<T> |
addChild(TreeNode<T> child)
Add the specified child node.
|
TreeNode<T> |
addChild(T child,
String name)
Add a child node for the provided object.
|
TreeNode<T> |
getChild(String name)
Find a child node by name.
|
Collection<TreeNode<T>> |
getChildren()
Obtain the list of child nodes.
|
String |
getName()
Obtain the name of the node.
|
T |
getObject()
Obtain the object associated with this node.
|
TreeNode<T> |
getParent()
Obtain the parent node or null if this node is the root.
|
Object |
getProperty(String name)
Get the specified node property.
|
String |
getStringProperty(String name)
Get the specified node property as a String.
|
TreeNode<T> |
removeChild(String name)
Remove a child from this resource.
|
void |
removeProperty(String name)
Remove a property from the node.
|
void |
setName(String name)
Set the name of the node.
|
void |
setParent(TreeNode<T> parent)
Set the parent node.
|
void |
setProperty(String name,
Object value)
Set a property on the node.
|
public TreeNode<T> getParent()
TreeNode
public Collection<TreeNode<T>> getChildren()
TreeNode
getChildren
in interface TreeNode<T>
public T getObject()
TreeNode
public void setName(String name)
TreeNode
public String getName()
TreeNode
public void setParent(TreeNode<T> parent)
TreeNode
public TreeNode<T> addChild(T child, String name)
TreeNode
public TreeNode<T> addChild(TreeNode<T> child)
TreeNode
public TreeNode<T> removeChild(String name)
TreeNode
removeChild
in interface TreeNode<T>
name
- name of child to removepublic void setProperty(String name, Object value)
TreeNode
setProperty
in interface TreeNode<T>
name
- the name of the propertyvalue
- the value of the propertypublic Object getProperty(String name)
TreeNode
getProperty
in interface TreeNode<T>
name
- property namepublic String getStringProperty(String name)
TreeNode
getStringProperty
in interface TreeNode<T>
name
- property namepublic void removeProperty(String name)
TreeNode
removeProperty
in interface TreeNode<T>
name
- name of property to be removedCopyright © 2022 Apache Software Foundation. All rights reserved.