Class PropertyOwnerPointer

java.lang.Object
org.apache.commons.jxpath.ri.model.NodePointer
org.apache.commons.jxpath.ri.model.beans.PropertyOwnerPointer
All Implemented Interfaces:
Serializable, Cloneable, Comparable, Pointer
Direct Known Subclasses:
BeanPointer, DynaBeanPointer, DynamicPointer, NullPointer

public abstract class PropertyOwnerPointer extends NodePointer
A pointer describing a node that has properties, each of which could be a collection.
See Also:
  • Constructor Details

  • Method Details

    • attributeIterator

      Description copied from class: NodePointer
      Returns a NodeIterator that iterates over all attributes of the current node matching the supplied node name (could have a wildcard). May return null if the object does not support the attributes.
      Overrides:
      attributeIterator in class NodePointer
      Parameters:
      qName - the attribute name to test
      Returns:
      NodeIterator
    • childIterator

      public NodeIterator childIterator(NodeTest test, boolean reverse, NodePointer startWith)
      Description copied from class: NodePointer
      Returns a NodeIterator that iterates over all children or all children that match the given NodeTest, starting with the specified one.
      Overrides:
      childIterator in class NodePointer
      Parameters:
      test - NodeTest to filter children
      reverse - specified iteration direction
      startWith - the NodePointer to start with
      Returns:
      NodeIterator
    • compareChildNodePointers

      public int compareChildNodePointers(NodePointer pointer1, NodePointer pointer2)
      Description copied from class: NodePointer
      Compares two child NodePointers and returns a positive number, zero or a positive number according to the order of the pointers.
      Specified by:
      compareChildNodePointers in class NodePointer
      Parameters:
      pointer1 - first pointer to be compared
      pointer2 - second pointer to be compared
      Returns:
      int per Java comparison conventions
    • createNodeIterator

      public NodeIterator createNodeIterator(String property, boolean reverse, NodePointer startWith)
      Create a NodeIterator.
      Parameters:
      property - property name
      reverse - whether to iterate in reverse
      startWith - first pointer to return
      Returns:
      NodeIterator
    • getImmediateNode

      Description copied from class: NodePointer
      Returns the object the pointer points to; does not convert it to a "canonical" type.
      Specified by:
      getImmediateNode in class NodePointer
      Returns:
      Object node
    • getName

      public abstract QName getName()
      Description copied from class: NodePointer
      Gets the name of this node. Can be null.
      Specified by:
      getName in class NodePointer
      Returns:
      QName The name of this node. Can be null.
    • getPropertyPointer

      Gets a PropertyPointer for this PropertyOwnerPointer.
      Returns:
      PropertyPointer
    • isDynamicPropertyDeclarationSupported

      Tests whether dynamic property declaration is supported.
      Returns:
      true if the property owner can set a property "does not exist". A good example is a Map. You can always assign a value to any key even if it has never been "declared".
    • isValidProperty

      public boolean isValidProperty(QName qName)
      Tests whether name is a valid child name for this PropertyOwnerPointer.
      Parameters:
      qName - the QName to test
      Returns:
      true if QName is a valid property name.
      Since:
      JXPath 1.3
    • remove

      public void remove()
      If this is a root node pointer, throws an exception; otherwise forwards the call to the parent node.
      Overrides:
      remove in class NodePointer
    • setIndex

      public void setIndex(int index)
      Description copied from class: NodePointer
      Sets the index of this NodePointer.
      Overrides:
      setIndex in class NodePointer
      Parameters:
      index - int
    • setValue

      public void setValue(Object value)
      Throws an exception if you try to change the root element, otherwise forwards the call to the parent pointer.
      Specified by:
      setValue in interface Pointer
      Specified by:
      setValue in class NodePointer
      Parameters:
      value - to set