|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.commons.configuration.HierarchicalConfiguration.Node
A data class for storing (hierarchical) property information. A property can have a value and an arbitrary number of child properties.
Constructor Summary | |
HierarchicalConfiguration.Node()
Creates a new instance of Node . |
|
HierarchicalConfiguration.Node(String name)
Creates a new instance of Node and sets the name. |
|
HierarchicalConfiguration.Node(String name,
Object value)
Creates a new instance of Node and sets the name and the value. |
Method Summary | |
void |
addChild(HierarchicalConfiguration.Node child)
Adds the specified child object to this node. |
Object |
clone()
Creates a copy of this object. |
List |
getChildren()
Returns a list with the child nodes of this node. |
List |
getChildren(String name)
Returns a list with this node's children with the given name. |
String |
getName()
Returns the name of this node. |
HierarchicalConfiguration.Node |
getParent()
Returns the parent of this node. |
Object |
getReference()
Returns the reference object for this node. |
Object |
getValue()
Returns the value of this node. |
boolean |
hasChildren()
Returns a flag whether this node has child elements. |
boolean |
remove(HierarchicalConfiguration.Node child)
Removes the specified child from this node. |
boolean |
remove(String name)
Removes all children with the given name. |
void |
removeChildren()
Removes all children of this node. |
protected void |
removeReference()
Deals with the reference when a node is removed. |
void |
setName(String string)
Sets the name of this node. |
void |
setParent(HierarchicalConfiguration.Node node)
Sets the parent of this node. |
void |
setReference(Object ref)
Sets the reference object for this node. |
void |
setValue(Object object)
Sets the value of this node. |
void |
visit(HierarchicalConfiguration.NodeVisitor visitor,
ConfigurationKey key)
A generic method for traversing this node and all of its children. |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public HierarchicalConfiguration.Node()
Node
.public HierarchicalConfiguration.Node(String name)
Node
and sets the name.name
- the node's namepublic HierarchicalConfiguration.Node(String name, Object value)
Node
and sets the name and the value.name
- the node's namevalue
- the valueMethod Detail |
public String getName()
public Object getValue()
public HierarchicalConfiguration.Node getParent()
public void setName(String string)
string
- the node namepublic void setValue(Object object)
object
- the node valuepublic void setParent(HierarchicalConfiguration.Node node)
node
- the parent nodepublic Object getReference()
public void setReference(Object ref)
HierarchicalConfiguration
. In an XML
configuration e.g. this reference could be an element in a
corresponding XML document. The reference is used by the
BuilderVisitor
class when the configuration is stored.ref
- the reference objectpublic void addChild(HierarchicalConfiguration.Node child)
child
- the child to be addedpublic List getChildren()
public List getChildren(String name)
name
- the name of the childrenpublic boolean hasChildren()
public boolean remove(HierarchicalConfiguration.Node child)
child
- the child node to be removedpublic boolean remove(String name)
name
- the name of the children to be removedpublic void removeChildren()
public void visit(HierarchicalConfiguration.NodeVisitor visitor, ConfigurationKey key)
visitor
- the visitorkey
- here a configuration key with the name of the root node of
the iteration can be passed; if this key is not null , the
full pathes to the visited nodes are builded and passed to the
visitor's visit()
methodspublic Object clone()
clone
in class Object
protected void removeReference()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |