Class ConfigurationAttributePointer<T>

java.lang.Object
org.apache.commons.jxpath.ri.model.NodePointer
org.apache.commons.configuration2.tree.xpath.ConfigurationAttributePointer<T>
Type Parameters:
T - the type of the nodes this pointer deals with
All Implemented Interfaces:
Serializable, Cloneable, Comparable, org.apache.commons.jxpath.Pointer

final class ConfigurationAttributePointer<T> extends org.apache.commons.jxpath.ri.model.NodePointer

A specialized NodePointer implementation for the attributes of a configuration node.

Since:
2.0
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final QueryResult<T>
    Stores information about the represented attribute.
    private static final long
    The serial version UID.

    Fields inherited from class org.apache.commons.jxpath.ri.model.NodePointer

    index, locale, parent, UNKNOWN_NAMESPACE, WHOLE_COLLECTION
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a new instance of ConfigurationAttributePointer.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    compareChildNodePointers(org.apache.commons.jxpath.ri.model.NodePointer p1, org.apache.commons.jxpath.ri.model.NodePointer p2)
    Compares two child node pointers.
    Gets the base value.
    Gets the immediate node.
    int
    Gets the length of the represented node.
    org.apache.commons.jxpath.ri.QName
    Gets the name of this node.
    private NodeHandler<T>
    Returns a reference to the current node handler.
    Gets a reference to the parent node pointer.
    Returns the value of this node.
    boolean
    Returns a flag whether this node is an attribute.
    boolean
    Returns a flag whether the represented node is a collection.
    boolean
    Returns a flag whether the represented node is a leaf.
    void
    Sets the value of this node.
    boolean
    testNode(org.apache.commons.jxpath.ri.compiler.NodeTest test)
    Tests if this node matches the given test.

    Methods inherited from class org.apache.commons.jxpath.ri.model.NodePointer

    asPath, attributeIterator, childIterator, clone, compareTo, createAttribute, createChild, createChild, createPath, createPath, escape, getAbstractFactory, getDefaultNamespaceURI, getImmediateParentPointer, getImmediateValuePointer, getIndex, getLocale, getNamespaceResolver, getNamespaceURI, getNamespaceURI, getNode, getNodeSetByKey, getNodeValue, getParent, getPointerByID, getPointerByKey, getRootNode, getValuePointer, isActual, isContainer, isDefaultNamespace, isLanguage, isNode, isRoot, namespaceIterator, namespacePointer, newChildNodePointer, newNodePointer, printPointerChain, remove, setAttribute, setIndex, setNamespaceResolver, toString

    Methods inherited from class java.lang.Object

    equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      The serial version UID.
      See Also:
    • attributeResult

      private final QueryResult<T> attributeResult
      Stores information about the represented attribute.
  • Constructor Details

    • ConfigurationAttributePointer

      public ConfigurationAttributePointer(ConfigurationNodePointer<T> parent, String attrName)
      Creates a new instance of ConfigurationAttributePointer.
      Parameters:
      parent - the parent node pointer
      attrName - the name of the managed attribute
  • Method Details

    • getParentPointer

      public ConfigurationNodePointer<T> getParentPointer()
      Gets a reference to the parent node pointer.
      Returns:
      the parent pointer
    • compareChildNodePointers

      public int compareChildNodePointers(org.apache.commons.jxpath.ri.model.NodePointer p1, org.apache.commons.jxpath.ri.model.NodePointer p2)
      Compares two child node pointers. Attributes do not have any children, so this is just a dummy implementation.
      Specified by:
      compareChildNodePointers in class org.apache.commons.jxpath.ri.model.NodePointer
      Parameters:
      p1 - the first pointer
      p2 - the second pointer
      Returns:
      the order of these pointers
    • getBaseValue

      public Object getBaseValue()
      Gets the base value. We return the value.
      Specified by:
      getBaseValue in class org.apache.commons.jxpath.ri.model.NodePointer
      Returns:
      the base value
    • getImmediateNode

      public Object getImmediateNode()
      Gets the immediate node. This is actually a QueryResult object describing the represented attribute.
      Specified by:
      getImmediateNode in class org.apache.commons.jxpath.ri.model.NodePointer
      Returns:
      the immediate node
    • getLength

      public int getLength()
      Gets the length of the represented node. This is always 1.
      Specified by:
      getLength in class org.apache.commons.jxpath.ri.model.NodePointer
      Returns:
      the length
    • getName

      public org.apache.commons.jxpath.ri.QName getName()
      Gets the name of this node. This is the attribute name.
      Specified by:
      getName in class org.apache.commons.jxpath.ri.model.NodePointer
      Returns:
      the name of this node
    • isCollection

      public boolean isCollection()
      Returns a flag whether the represented node is a collection. This is not the case.
      Specified by:
      isCollection in class org.apache.commons.jxpath.ri.model.NodePointer
      Returns:
      the collection flag
    • isLeaf

      public boolean isLeaf()
      Returns a flag whether the represented node is a leaf. This is the case for attributes.
      Specified by:
      isLeaf in class org.apache.commons.jxpath.ri.model.NodePointer
      Returns:
      the leaf flag
    • isAttribute

      public boolean isAttribute()
      Returns a flag whether this node is an attribute. Of course, this is the case.
      Overrides:
      isAttribute in class org.apache.commons.jxpath.ri.model.NodePointer
      Returns:
      the attribute flag
    • getValue

      public Object getValue()
      Returns the value of this node.
      Specified by:
      getValue in interface org.apache.commons.jxpath.Pointer
      Overrides:
      getValue in class org.apache.commons.jxpath.ri.model.NodePointer
      Returns:
      this node's value
    • setValue

      public void setValue(Object value)
      Sets the value of this node. This is not supported because the classes of the XPathExpressionEngine are only used for queries. This implementation always throws an exception.
      Specified by:
      setValue in interface org.apache.commons.jxpath.Pointer
      Specified by:
      setValue in class org.apache.commons.jxpath.ri.model.NodePointer
      Parameters:
      value - the new value
    • testNode

      public boolean testNode(org.apache.commons.jxpath.ri.compiler.NodeTest test)
      Tests if this node matches the given test. Attribute nodes are text nodes, too, because they can contain a value.
      Overrides:
      testNode in class org.apache.commons.jxpath.ri.model.NodePointer
      Parameters:
      test - the test object
      Returns:
      a flag if this node corresponds to the test
    • getNodeHandler

      private NodeHandler<T> getNodeHandler()
      Returns a reference to the current node handler. The handler is obtained from the parent pointer.
      Returns:
      the node handler