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 T
The 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) String
escapedNodeName
(HierarchicalConfiguration<?> config) Returns the unescaped name of the node stored in this data object.(package private) Object
getAttribute
(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 intoNodeData
objects.(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 intoNodeData
objects.(package private) boolean
matchesConfigRootNode
(HierarchicalConfiguration<?> config) Returns a flag whether the wrapped node is the root node of the passed in configuration.(package private) String
nodeName()
Returns the name of the wrapped node.(package private) List
<XMLBeanDeclaration.NodeData<T>> wrapInNodeData
(List<T> nodes) Wraps the passed in list of nodes inNodeData
objects.
-
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
-
nodeName
String nodeName()Returns the name of the wrapped node.- Returns:
- the node name
-
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
-
getChildren
List<XMLBeanDeclaration.NodeData<T>> getChildren()Gets a list with the children of the wrapped node, again wrapped intoNodeData
objects.- Returns:
- a list with the children
-
getChildren
Gets a list with the children of the wrapped node with the given name, again wrapped intoNodeData
objects.- Parameters:
name
- the name of the desired child nodes- Returns:
- a list with the children with this name
-
getAttributes
Gets a set with the names of the attributes of the wrapped node.- Returns:
- the attribute names of this node
-
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
-
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
-
wrapInNodeData
Wraps the passed in list of nodes inNodeData
objects.- Parameters:
nodes
- the list with nodes- Returns:
- the wrapped nodes
-