Class ViewNode
java.lang.Object
org.apache.commons.configuration.tree.DefaultConfigurationNode
org.apache.commons.configuration.tree.ViewNode
- All Implemented Interfaces:
Cloneable, ConfigurationNode
A specialized node implementation to be used in view configurations.
Some configurations provide a logical view on the nodes of other configurations. These configurations construct their own hierarchy of nodes based on the node trees of their source configurations. This special node class can be used for this purpose. It allows child nodes and attributes to be added without changing their parent node. So a node can belong to a hierarchy of nodes of a source configuration, but be also contained in a view configuration.
- Since:
- 1.3
- Version:
- $Id: ViewNode.java 1206488 2011-11-26 16:42:41Z oheger $
- Author:
- Commons Configuration team
-
Nested Class Summary
Nested classes/interfaces inherited from class DefaultConfigurationNode
DefaultConfigurationNode.SubNodes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds an attribute to this view node.voidaddChild(ConfigurationNode child) Adds a child node to this view node.voidappendAttributes(ConfigurationNode source) Adds all attribute nodes of the given source node to this view node.voidappendChildren(ConfigurationNode source) Adds all child nodes of the given source node to this view node.Methods inherited from class DefaultConfigurationNode
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
-
Constructor Details
-
ViewNode
public ViewNode()
-
-
Method Details
-
addAttribute
Adds an attribute to this view node. The new attribute's parent node will be saved.- Specified by:
addAttributein interfaceConfigurationNode- Overrides:
addAttributein classDefaultConfigurationNode- Parameters:
attr- the attribute node to be added
-
addChild
Adds a child node to this view node. The new child's parent node will be saved.- Specified by:
addChildin interfaceConfigurationNode- Overrides:
addChildin classDefaultConfigurationNode- Parameters:
child- the child node to be added
-
appendAttributes
Adds all attribute nodes of the given source node to this view node.- Parameters:
source- the source node
-
appendChildren
Adds all child nodes of the given source node to this view node.- Parameters:
source- the source node
-