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

# Class BeanPropertyPointer

java.lang.Object
org.apache.commons.jxpath.ri.model.NodePointer
org.apache.commons.jxpath.ri.model.beans.PropertyPointer
org.apache.commons.jxpath.ri.model.beans.BeanPropertyPointer

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

public class BeanPropertyPointer extends PropertyPointer
Pointer to a property of a JavaBean.

See Also:
  - Serialized Form

- ## Field Summary

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

  `bean, propertyIndex, UNSPECIFIED_PROPERTY`

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

  `index, locale, parent, UNKNOWN_NAMESPACE, WHOLE_COLLECTION`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `BeanPropertyPointer(NodePointer parent, JXPathBeanInfo beanInfo)`
  Constructs a new BeanPropertyPointer.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `NodePointer`
  `createPath(JXPathContext context)`
  Called by a child pointer when it needs to create a parent object.
  `Object`
  `getBaseValue()`
  Gets the value of the currently selected property.
  `Object`
  `getImmediateNode()`
  If index == WHOLE_COLLECTION, the value of the property, otherwise the value of the index'th element of the collection represented by the property.
  `int`
  `getLength()`
  If the property contains a collection, then the length of that collection, otherwise - 1.
  `int`
  `getPropertyCount()`
  Count the number of properties represented.
  `protected PropertyDescriptor[]`
  `getPropertyDescriptors()`
  Gets all PropertyDescriptors.
  `String`
  `getPropertyName()`
  Gets the name of the currently selected property.
  `String[]`
  `getPropertyNames()`
  Gets the names of all properties, sorted alphabetically.
  `protected boolean`
  `isActualProperty()`
  Tests whether this pointer references an actual property.
  `boolean`
  `isCollection()`
  Returns `true` if the value of the pointer is an array or a Collection.
  `boolean`
  `isContainer()`
  This type of node is auxiliary.
  `void`
  `remove()`
  Remove the node of the object graph this pointer points to.
  `void`
  `setIndex(int index)`
  Sets the index of this NodePointer.
  `void`
  `setPropertyIndex(int index)`
  Selects a property by its offset in the alphabetically sorted list.
  `void`
  `setPropertyName(String propertyName)`
  Select a property by name.
  `void`
  `setValue(Object value)`
  If index == WHOLE_COLLECTION, change the value of the property, otherwise change the value of the index'th element of the collection represented by the property.

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

  `compareChildNodePointers, createChild, createChild, createPath, equals, getBean, getImmediateValuePointer, getName, getPropertyIndex, hashCode, isActual, isLeaf`

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

  `asPath, attributeIterator, childIterator, clone, compareTo, createAttribute, escape, getAbstractFactory, getDefaultNamespaceURI, getImmediateParentPointer, getIndex, getLocale, getNamespaceResolver, getNamespaceURI, getNamespaceURI, getNode, getNodeSetByKey, getNodeValue, getParent, getPointerByID, getPointerByKey, getRootNode, getValue, getValuePointer, handle, handle, isAttribute, 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

  - ### BeanPropertyPointer

    public BeanPropertyPointer(NodePointer parent, JXPathBeanInfo beanInfo)
    Constructs a new BeanPropertyPointer.
    Parameters:
      `parent` - parent pointer
      `beanInfo` - describes the target property/ies.

- ## Method Details

  - ### createPath

    public NodePointer createPath(JXPathContext context)
    Description copied from class: `NodePointer`
    Called by a child pointer when it needs to create a parent object. Must create an object described by this pointer and return a new pointer that properly describes the new object.
    Overrides:
      `createPath` in class `PropertyPointer`
    Parameters:
      `context` - the owning JXPathContext
    Returns:
      created NodePointer

  - ### getBaseValue

    public Object getBaseValue()
    Gets the value of the currently selected property.
    Specified by:
      `getBaseValue` in class `NodePointer`
    Returns:
      Object value

  - ### getImmediateNode

    public Object getImmediateNode()
    If index == WHOLE_COLLECTION, the value of the property, otherwise the value of the index'th element of the collection represented by the property. If the property is not a collection, index should be zero and the value will be the property itself.
    Overrides:
      `getImmediateNode` in class `PropertyPointer`
    Returns:
      Object

  - ### getLength

    public int getLength()
    If the property contains a collection, then the length of that collection, otherwise - 1.
    Overrides:
      `getLength` in class `PropertyPointer`
    Returns:
      int length

  - ### getPropertyCount

    public int getPropertyCount()
    Description copied from class: `PropertyPointer`
    Count the number of properties represented.
    Specified by:
      `getPropertyCount` in class `PropertyPointer`
    Returns:
      int

  - ### getPropertyDescriptors

    protected PropertyDescriptor[] getPropertyDescriptors()
    Gets all PropertyDescriptors.
    Returns:
      PropertyDescriptor[]

  - ### getPropertyName

    public String getPropertyName()
    Gets the name of the currently selected property.
    Specified by:
      `getPropertyName` in class `PropertyPointer`
    Returns:
      String property name

  - ### getPropertyNames

    public String[] getPropertyNames()
    Gets the names of all properties, sorted alphabetically.
    Specified by:
      `getPropertyNames` in class `PropertyPointer`
    Returns:
      String[]

  - ### isActualProperty

    protected boolean isActualProperty()
    Description copied from class: `PropertyPointer`
    Tests whether this pointer references an actual property.
    Specified by:
      `isActualProperty` in class `PropertyPointer`
    Returns:
      true if actual

  - ### isCollection

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

  - ### isContainer

    public boolean isContainer()
    This type of node is auxiliary.
    Overrides:
      `isContainer` in class `NodePointer`
    Returns:
      true

  - ### remove

    public void remove()
    Description copied from class: `NodePointer`
    Remove the node of the object graph this pointer points to.
    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

  - ### setPropertyIndex

    public void setPropertyIndex(int index)
    Selects a property by its offset in the alphabetically sorted list.
    Overrides:
      `setPropertyIndex` in class `PropertyPointer`
    Parameters:
      `index` - property index

  - ### setPropertyName

    public void setPropertyName(String propertyName)
    Select a property by name.
    Specified by:
      `setPropertyName` in class `PropertyPointer`
    Parameters:
      `propertyName` - String name

  - ### setValue

    public void setValue(Object value)
    If index == WHOLE_COLLECTION, change the value of the property, otherwise change the value of the index'th element of the collection represented by the property.
    Specified by:
      `setValue` in interface `Pointer`
    Specified by:
      `setValue` in class `NodePointer`
    Parameters:
      `value` - value to set