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 Details

    • WILDCARD

      private static final String WILDCARD
      Constant for the wildcard node name.
      See Also:
    • parentPointer

      private final ConfigurationNodePointer<T> parentPointer
      Stores the parent node pointer.
    • attributeNames

      private final List<String> 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 of ConfigurationNodeIteratorAttribute.
      Parameters:
      parent - the parent node pointer
      name - the name of the selected attribute
  • Method Details

    • addAttributeData

      private 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.
      Parameters:
      parent - the parent node pointer
      result - the result list
      name - 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 pointer
      name - 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 class AbstractConfigurationNodeIterator<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 class AbstractConfigurationNodeIterator<T>
      Returns:
      the iteration size