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
final class ConfigurationNodeIteratorAttribute<T> extends AbstractConfigurationNodeIterator<T>
A specialized node iterator implementation that deals with attribute nodes.
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.List<java.lang.String>
attributeNames
A list with the names of the managed attributes.private ConfigurationNodePointer<T>
parentPointer
Stores the parent node pointer.private static java.lang.String
WILDCARD
Constant for the wildcard node name.
-
Constructor Summary
Constructors Constructor Description ConfigurationNodeIteratorAttribute(ConfigurationNodePointer<T> parent, org.apache.commons.jxpath.ri.QName name)
Creates a new instance ofConfigurationNodeIteratorAttribute
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
addAttributeData(ConfigurationNodePointer<T> parent, java.util.List<java.lang.String> result, java.lang.String name)
Helper method for checking whether an attribute is defined and adding it to the list of attributes to iterate over.private java.util.List<java.lang.String>
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 Detail
-
WILDCARD
private static final java.lang.String WILDCARD
Constant for the wildcard node name.- See Also:
- Constant Field Values
-
parentPointer
private final ConfigurationNodePointer<T> parentPointer
Stores the parent node pointer.
-
attributeNames
private final java.util.List<java.lang.String> attributeNames
A list with the names of the managed attributes.
-
-
Constructor Detail
-
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 Detail
-
addAttributeData
private void addAttributeData(ConfigurationNodePointer<T> parent, java.util.List<java.lang.String> result, java.lang.String name)
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 java.util.List<java.lang.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
-
-