Class ConfigurationNodeIteratorAttribute<T>
java.lang.Object
org.apache.commons.configuration2.tree.xpath.AbstractConfigurationNodeIterator<T>
org.apache.commons.configuration2.tree.xpath.ConfigurationNodeIteratorAttribute<T>
- Type Parameters:
T
- the type of the nodes this iterator deals with
- All Implemented Interfaces:
org.apache.commons.jxpath.ri.model.NodeIterator
A specialized node iterator implementation that deals with attribute nodes.
-
Field Summary
FieldsModifier and TypeFieldDescriptionA list with the names of the managed attributes.private final ConfigurationNodePointer
<T> Stores the parent node pointer.private static final String
Constant for the wildcard node name. -
Constructor Summary
ConstructorsConstructorDescriptionConfigurationNodeIteratorAttribute
(ConfigurationNodePointer<T> parent, org.apache.commons.jxpath.ri.QName name) Creates a new instance ofConfigurationNodeIteratorAttribute
. -
Method Summary
Modifier and TypeMethodDescriptionprivate void
addAttributeData
(ConfigurationNodePointer<T> parent, List<String> result, String name) Helper method for checking whether an attribute is defined and adding it to the list of attributes to iterate over.createAttributeDataList
(ConfigurationNodePointer<T> parent, org.apache.commons.jxpath.ri.QName name) Determines which attributes are selected based on the passed in node name.protected org.apache.commons.jxpath.ri.model.NodePointer
createNodePointer
(int position) Creates a pointer for the node at the specified position.protected int
size()
Returns the size of the managed iteration.Methods inherited from class org.apache.commons.configuration2.tree.xpath.AbstractConfigurationNodeIterator
getMaxPosition, getNodeHandler, getNodePointer, getParent, getPosition, getStartOffset, positionToIndex, prefixName, qualifiedName, setPosition, setStartOffset
-
Field Details
-
WILDCARD
Constant for the wildcard node name.- See Also:
-
parentPointer
Stores the parent node pointer. -
attributeNames
A list with the names of the managed attributes.
-
-
Constructor Details
-
ConfigurationNodeIteratorAttribute
public ConfigurationNodeIteratorAttribute(ConfigurationNodePointer<T> parent, org.apache.commons.jxpath.ri.QName name) Creates a new instance ofConfigurationNodeIteratorAttribute
.- Parameters:
parent
- the parent node pointername
- the name of the selected attribute
-
-
Method Details
-
addAttributeData
Helper method for checking whether an attribute is defined and adding it to the list of attributes to iterate over.- Parameters:
parent
- the parent node pointerresult
- the result listname
- the name of the current attribute
-
createAttributeDataList
private List<String> createAttributeDataList(ConfigurationNodePointer<T> parent, org.apache.commons.jxpath.ri.QName name) Determines which attributes are selected based on the passed in node name.- Parameters:
parent
- the parent node pointername
- the name of the selected attribute- Returns:
- a list with the selected attributes
-
createNodePointer
protected org.apache.commons.jxpath.ri.model.NodePointer createNodePointer(int position) Creates a pointer for the node at the specified position.- Specified by:
createNodePointer
in classAbstractConfigurationNodeIterator<T>
- Parameters:
position
- the desired position- Returns:
- a pointer for the attribute at this position
-
size
protected int size()Returns the size of the managed iteration.- Specified by:
size
in classAbstractConfigurationNodeIterator<T>
- Returns:
- the iteration size
-