public static class HierarchicalConfiguration.Node extends DefaultConfigurationNode implements Serializable
DefaultconfigurationNode
class that exists mainly for the purpose of backwards compatibility.DefaultConfigurationNode.SubNodes
Constructor and Description |
---|
HierarchicalConfiguration.Node()
Creates a new instance of
Node . |
HierarchicalConfiguration.Node(ConfigurationNode src)
Creates a new instance of
Node based on the given
source 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. |
Modifier and Type | Method and Description |
---|---|
void |
addChild(HierarchicalConfiguration.Node node)
Adds the given node to the children of this node.
|
HierarchicalConfiguration.Node |
getParent()
Returns the parent 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 |
setParent(HierarchicalConfiguration.Node node)
Sets the parent of this node.
|
void |
visit(HierarchicalConfiguration.NodeVisitor visitor,
ConfigurationKey key)
A generic method for traversing this node and all of its children.
|
addAttribute, addChild, checkState, clone, createSubNodes, getAttribute, getAttributeCount, getAttributeCount, getAttributes, getAttributes, getChild, getChildren, getChildren, getChildrenCount, getChildrenCount, getName, getParentNode, getReference, getValue, isAttribute, isDefined, removeAttribute, removeAttribute, removeAttributes, removeChild, removeChild, removeChildren, removeReference, setAttribute, setName, setParentNode, setReference, setValue, visit
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 valuepublic HierarchicalConfiguration.Node(ConfigurationNode src)
Node
based on the given
source node. All properties of the source node, including its
children and attributes, will be copied.src
- the node to be copiedpublic HierarchicalConfiguration.Node getParent()
public void setParent(HierarchicalConfiguration.Node node)
node
- the parent nodepublic void addChild(HierarchicalConfiguration.Node node)
node
- the child to be addedpublic 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 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()
methodsCopyright © 2018 JBoss by Red Hat. All rights reserved.