org.apache.commons.configuration.tree
public interface ConfigurationNode
Definition of an interface for the nodes of a hierarchical configuration.
This interface defines a tree like structure for configuration data. A node has a value and can have an arbitrary number of children and attribures.
Since: 1.3
Version: $Id: ConfigurationNode.java 439648 2006-09-02 20:42:10Z oheger $
Method Summary | |
---|---|
void | addAttribute(ConfigurationNode attr)
Adds the specified attribute to this node
|
void | addChild(ConfigurationNode node)
Adds a child to this node.
|
Object | clone()
Returns a copy of this node. |
ConfigurationNode | getAttribute(int index)
Returns the attribute node with the given index. |
int | getAttributeCount()
Returns the number of attributes of this node. |
int | getAttributeCount(String name)
Returns the number of attributes with the given name.
|
List | getAttributes()
Returns a list with this node's attributes. |
List | getAttributes(String name)
Returns a list with the attribute nodes with the given name. |
ConfigurationNode | getChild(int index)
Returns the child node with the given index. |
List | getChildren()
Returns a list with the child nodes of this node. |
List | getChildren(String name)
Returns a list with all children of this node with the given name.
|
int | getChildrenCount()
Returns the number of this node's children.
|
int | getChildrenCount(String name)
Returns the number of children with the given name.
|
String | getName()
Returns the name of this node.
|
ConfigurationNode | getParentNode()
Returns this node's parent. |
Object | getReference()
Returns this node's reference.
|
Object | getValue()
Returns the value of this node.
|
boolean | isAttribute()
Returns a flag whether this node is an attribute.
|
boolean | isDefined()
Returns a flag if this node is defined. |
boolean | removeAttribute(ConfigurationNode node)
Removes the specified attribute from this node.
|
boolean | removeAttribute(String name)
Removes all attributes with the given name.
|
void | removeAttributes()
Removes all attributes of this node. |
boolean | removeChild(ConfigurationNode child)
Removes the given node from this node's children.
|
boolean | removeChild(String childName)
Removes all child nodes of this node with the given name.
|
void | removeChildren()
Removes all children from this node. |
void | setAttribute(boolean f)
Sets a flag whether this node is an attribute.
|
void | setName(String name)
Sets the name of this node.
|
void | setParentNode(ConfigurationNode parent)
Sets the parent of this node.
|
void | setReference(Object ref)
Sets this node's reference. |
void | setValue(Object val)
Sets the value of this node.
|
void | visit(ConfigurationNodeVisitor visitor)
Visits this node and all its sub nodes. |
Parameters: attr the attribute node
Parameters: node the new child
Returns: the copy
Parameters: index the index
Returns: the attribute node with this index
Returns: the number of attributes
Parameters: name the name of the attribute
Returns: the number of attributes with this name
ConfigurationNode
objects.
Returns: a list with the attributes
Parameters: name the name of the attribute
Returns: the attribute nodes with this name (never null)
Parameters: index the index of the child node (0-based)
Returns: the child node with this index
Returns: a list with the children of this node (never null)
Parameters: name the name of the searched children
Returns: a list with all child nodes with this name (never null)
Returns: the number of the children of this node
Parameters: name the name
Returns: the number of children with this name
Returns: the node name
Returns: the parent of this node
Returns: the reference
Returns: the node's value
Returns: a flag whether this node is an attribute
Returns: a flag whether this node is defined
Parameters: node the attribute to remove
Returns: a flag if the node could be removed
Parameters: name the name of the attributes to be removed
Returns: a flag if at least one attribute was removed
Parameters: child the child node to be removed
Returns: a flag if the node could be removed
Parameters: childName the name of the children to be removed
Returns: a flag if at least one child was removed
Parameters: f the attribute flag
Parameters: name the node name
Parameters: parent the parent of this node
Parameters: ref the reference
Parameters: val the node's value
Parameters: visitor the visitor
See Also: ConfigurationNodeVisitor