Class XMLBeanDeclaration.NodeData<T>
java.lang.Object
org.apache.commons.configuration2.beanutils.XMLBeanDeclaration.NodeData<T>
- Type Parameters:
T- the type of the node
- Enclosing class:
XMLBeanDeclaration
An internal helper class which wraps the node with the bean declaration and the corresponding node handler.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final TThe wrapped node.private final NodeHandler<T> The node handler for interacting with this node. -
Constructor Summary
ConstructorsConstructorDescriptionNodeData(T node, NodeHandler<T> nodeHandler) Constructs a new instance ofNodeData. -
Method Summary
Modifier and TypeMethodDescription(package private) StringescapedNodeName(HierarchicalConfiguration<?> config) Returns the unescaped name of the node stored in this data object.(package private) ObjectgetAttribute(String key) Gets the value of the attribute with the given name of the wrapped node.Gets a set with the names of the attributes of the wrapped node.(package private) List<XMLBeanDeclaration.NodeData<T>> Gets a list with the children of the wrapped node, again wrapped intoNodeDataobjects.(package private) List<XMLBeanDeclaration.NodeData<T>> getChildren(String name) Gets a list with the children of the wrapped node with the given name, again wrapped intoNodeDataobjects.(package private) booleanmatchesConfigRootNode(HierarchicalConfiguration<?> config) Returns a flag whether the wrapped node is the root node of the passed in configuration.(package private) StringnodeName()Returns the name of the wrapped node.(package private) List<XMLBeanDeclaration.NodeData<T>> wrapInNodeData(List<T> nodes) Wraps the passed in list of nodes inNodeDataobjects.
-
Field Details
-
node
The wrapped node. -
nodeHandler
The node handler for interacting with this node.
-
-
Constructor Details
-
NodeData
NodeData(T node, NodeHandler<T> nodeHandler) Constructs a new instance ofNodeData.- Parameters:
node- the nodenodeHandler- the node handler
-
-
Method Details
-
escapedNodeName
Returns the unescaped name of the node stored in this data object. This method handles the case that the node name may contain reserved characters with a special meaning for the current expression engine. In this case, the characters affected have to be escaped accordingly.- Parameters:
config- the configuration- Returns:
- the escaped node name
-
getAttribute
Gets the value of the attribute with the given name of the wrapped node.- Parameters:
key- the key of the attribute- Returns:
- the value of this attribute
-
getAttributes
Gets a set with the names of the attributes of the wrapped node.- Returns:
- the attribute names of this node
-
getChildren
List<XMLBeanDeclaration.NodeData<T>> getChildren()Gets a list with the children of the wrapped node, again wrapped intoNodeDataobjects.- Returns:
- a list with the children
-
getChildren
Gets a list with the children of the wrapped node with the given name, again wrapped intoNodeDataobjects.- Parameters:
name- the name of the desired child nodes- Returns:
- a list with the children with this name
-
matchesConfigRootNode
Returns a flag whether the wrapped node is the root node of the passed in configuration.- Parameters:
config- the configuration- Returns:
- a flag whether this node is the configuration's root node
-
nodeName
String nodeName()Returns the name of the wrapped node.- Returns:
- the node name
-
wrapInNodeData
Wraps the passed in list of nodes inNodeDataobjects.- Parameters:
nodes- the list with nodes- Returns:
- the wrapped nodes
-