public interface TreeNode<T>
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.
|
TreeNode<T> getParent()
Collection<TreeNode<T>> getChildren()
T getObject()
String getName()
void setName(String name)
name
- the name to setvoid setParent(TreeNode<T> parent)
parent
- the parent node to setTreeNode<T> addChild(T child, String name)
child
- the object associated with the new child nodename
- the name of the child nodeTreeNode<T> addChild(TreeNode<T> child)
child
- the child node to addTreeNode<T> removeChild(String name)
name
- name of child to removevoid setProperty(String name, Object value)
name
- the name of the propertyvalue
- the value of the propertyObject getProperty(String name)
name
- property nameString getStringProperty(String name)
name
- property namevoid removeProperty(String name)
name
- name of property to be removedTreeNode<T> getChild(String name)
name
- the name of the child. May contain the '/' path separator.Copyright © 2022 Apache Software Foundation. All rights reserved.