Package org.apache.commons.jxpath.ri.model.dynamic

# Class DynamicPointer

java.lang.Object
org.apache.commons.jxpath.ri.model.NodePointer
org.apache.commons.jxpath.ri.model.beans.PropertyOwnerPointer
org.apache.commons.jxpath.ri.model.dynamic.DynamicPointer

All Implemented Interfaces:
  `Serializable`, `Cloneable`, `Comparable`, `Pointer`

public class DynamicPointer extends PropertyOwnerPointer
A Pointer that points to an object with Dynamic Properties. It is used for the first element of a path; following elements will by of type `PropertyPointer`.

See Also:
  - Serialized Form

- ## Field Summary

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

  `index, locale, parent, UNKNOWN_NAMESPACE, WHOLE_COLLECTION`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `DynamicPointer(NodePointer parent, QName qName, Object bean, DynamicPropertyHandler handler)`
  Constructs a new DynamicPointer.
  `DynamicPointer(QName qName, Object bean, DynamicPropertyHandler handler, Locale locale)`
  Constructs a new DynamicPointer.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `String`
  `asPath()`
  Returns an XPath that maps to this Pointer.
  `NodeIterator`
  `attributeIterator(QName qName)`
  Returns a NodeIterator that iterates over all attributes of the current node matching the supplied node name (could have a wildcard).
  `NodeIterator`
  `createNodeIterator(String property, boolean reverse, NodePointer startWith)`
  Create a NodeIterator.
  `boolean`
  `equals(Object object)`
  `Object`
  `getBaseValue()`
  Returns the DP object iself.
  `int`
  `getLength()`
  Returns 1.
  `QName`
  `getName()`
  Gets the name of this node.
  `PropertyPointer`
  `getPropertyPointer()`
  Gets a PropertyPointer for this PropertyOwnerPointer.
  `int`
  `hashCode()`
  `boolean`
  `isCollection()`
  Returns `true` if the value of the pointer is an array or a Collection.
  `boolean`
  `isDynamicPropertyDeclarationSupported()`
  Tests whether dynamic property declaration is supported.
  `boolean`
  `isLeaf()`
  If true, this node does not have children

  ### Methods inherited from class org.apache.commons.jxpath.ri.model.beans.PropertyOwnerPointer

  `childIterator, compareChildNodePointers, getImmediateNode, isValidProperty, remove, setIndex, setValue`

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

  `clone, compareTo, createAttribute, createChild, createChild, createPath, createPath, escape, getAbstractFactory, getDefaultNamespaceURI, getImmediateParentPointer, getImmediateValuePointer, getIndex, getLocale, getNamespaceResolver, getNamespaceURI, getNamespaceURI, getNode, getNodeSetByKey, getNodeValue, getParent, getPointerByID, getPointerByKey, getRootNode, getValue, getValuePointer, handle, handle, isActual, isAttribute, isContainer, isDefaultNamespace, isLanguage, isNode, isRoot, namespaceIterator, namespacePointer, newChildNodePointer, newNodePointer, printPointerChain, setAttribute, setExceptionHandler, setNamespaceResolver, testNode, toString, verify`

  ### Methods inherited from class java.lang.Object

  `finalize, getClass, notify, notifyAll, wait, wait, wait`

- ## Constructor Details

  - ### DynamicPointer

    public DynamicPointer(NodePointer parent, QName qName, Object bean, DynamicPropertyHandler handler)
    Constructs a new DynamicPointer.
    Parameters:
      `parent` - parent pointer
      `qName` - property name
      `bean` - owning bean
      `handler` - DynamicPropertyHandler

  - ### DynamicPointer

    public DynamicPointer(QName qName, Object bean, DynamicPropertyHandler handler, Locale locale)
    Constructs a new DynamicPointer.
    Parameters:
      `qName` - property name
      `bean` - owning bean
      `handler` - DynamicPropertyHandler
      `locale` - Locale

- ## Method Details

  - ### asPath

    public String asPath()
    Description copied from class: `NodePointer`
    Returns an XPath that maps to this Pointer.
    Specified by:
      `asPath` in interface `Pointer`
    Overrides:
      `asPath` in class `NodePointer`
    Returns:
      String XPath expression

  - ### attributeIterator

    public NodeIterator attributeIterator(QName qName)
    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 `PropertyOwnerPointer`
    Parameters:
      `qName` - the attribute name to test
    Returns:
      NodeIterator

  - ### createNodeIterator

    public NodeIterator createNodeIterator(String property, boolean reverse, NodePointer startWith)
    Description copied from class: `PropertyOwnerPointer`
    Create a NodeIterator.
    Overrides:
      `createNodeIterator` in class `PropertyOwnerPointer`
    Parameters:
      `property` - property name
      `reverse` - whether to iterate in reverse
      `startWith` - first pointer to return
    Returns:
      NodeIterator

  - ### equals

    public boolean equals(Object object)
    Overrides:
      `equals` in class `Object`

  - ### getBaseValue

    public Object getBaseValue()
    Returns the DP object iself.
    Specified by:
      `getBaseValue` in class `NodePointer`
    Returns:
      Object

  - ### getLength

    public int getLength()
    Returns 1.
    Specified by:
      `getLength` in class `NodePointer`
    Returns:
      int

  - ### getName

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

  - ### getPropertyPointer

    public PropertyPointer getPropertyPointer()
    Description copied from class: `PropertyOwnerPointer`
    Gets a PropertyPointer for this PropertyOwnerPointer.
    Specified by:
      `getPropertyPointer` in class `PropertyOwnerPointer`
    Returns:
      PropertyPointer

  - ### hashCode

    public int hashCode()
    Overrides:
      `hashCode` in class `Object`

  - ### isCollection

    public boolean isCollection()
    Description copied from class: `NodePointer`
    Returns `true` if the value of the pointer is an array or a Collection.
    Specified by:
      `isCollection` in class `NodePointer`
    Returns:
      boolean

  - ### isDynamicPropertyDeclarationSupported

    public boolean isDynamicPropertyDeclarationSupported()
    Description copied from class: `PropertyOwnerPointer`
    Tests whether dynamic property declaration is supported.
    Overrides:
      `isDynamicPropertyDeclarationSupported` in class `PropertyOwnerPointer`
    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".

  - ### isLeaf

    public boolean isLeaf()
    Description copied from class: `NodePointer`
    If true, this node does not have children
    Specified by:
      `isLeaf` in class `NodePointer`
    Returns:
      boolean