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

Class BeanPropertyPointer

Implemented Interfaces:
Cloneable, Comparable, Pointer, Serializable

public class BeanPropertyPointer
extends PropertyPointer

Pointer pointing to a property of a JavaBean.
Version:
$Revision: 1.17 $ $Date: 2004/04/04 22:06:36 $
Author:
Dmitri Plotnikov

Field Summary

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

UNSPECIFIED_PROPERTY, bean, propertyIndex

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

UNKNOWN_NAMESPACE, WHOLE_COLLECTION, index, locale, parent

Constructor Summary

BeanPropertyPointer(NodePointer parent, JXPathBeanInfo beanInfo)

Method Summary

NodePointer
createPath(JXPathContext context)
Object
getBaseValue()
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()
Number of the bean's properties.
protected PropertyDescriptor[]
getPropertyDescriptors()
String
getPropertyName()
Name of the currently selected property.
String[]
getPropertyNames()
Names of all properties, sorted alphabetically
protected boolean
isActualProperty()
boolean
isCollection()
boolean
isContainer()
This type of node is auxiliary.
void
remove()
void
setIndex(int index)
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, createPath, equals, getBean, getImmediateNode, getImmediateValuePointer, getLength, getName, getPropertyCount, getPropertyIndex, getPropertyName, getPropertyNames, hashCode, isActual, isActualProperty, isCollection, isLeaf, setPropertyIndex, setPropertyName

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

asPath, attributeIterator, childIterator, clone, compareChildNodePointers, compareTo, createAttribute, createChild, createChild, createPath, createPath, getBaseValue, getDefaultNamespaceURI, getImmediateNode, getImmediateParentPointer, getImmediateValuePointer, getIndex, getLength, getLocale, getName, getNamespaceResolver, getNamespaceURI, getNamespaceURI, getNode, getNodeValue, getParent, getPointerByID, getPointerByKey, getRootNode, getValue, getValuePointer, isActual, isAttribute, isCollection, isContainer, isDefaultNamespace, isLanguage, isLeaf, isNode, isRoot, namespaceIterator, namespacePointer, newChildNodePointer, newNodePointer, printPointerChain, remove, setAttribute, setIndex, setNamespaceResolver, setValue, testNode, toString

Constructor Details

BeanPropertyPointer

public BeanPropertyPointer(NodePointer parent,
                           JXPathBeanInfo beanInfo)

Method Details

createPath

public NodePointer createPath(JXPathContext context)
Overrides:
createPath in interface PropertyPointer

getBaseValue

public Object getBaseValue()
The value of the currently selected property.
Overrides:
getBaseValue in interface NodePointer

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 interface PropertyPointer

getLength

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

getPropertyCount

public int getPropertyCount()
Number of the bean's properties.
Overrides:
getPropertyCount in interface PropertyPointer

getPropertyDescriptors

protected PropertyDescriptor[] getPropertyDescriptors()

getPropertyName

public String getPropertyName()
Name of the currently selected property.
Overrides:
getPropertyName in interface PropertyPointer

getPropertyNames

public String[] getPropertyNames()
Names of all properties, sorted alphabetically
Overrides:
getPropertyNames in interface PropertyPointer

isActualProperty

protected boolean isActualProperty()
Overrides:
isActualProperty in interface PropertyPointer

isCollection

public boolean isCollection()
Overrides:
isCollection in interface PropertyPointer

isContainer

public boolean isContainer()
This type of node is auxiliary.
Overrides:
isContainer in interface NodePointer

remove

public void remove()
Overrides:
remove in interface NodePointer

setIndex

public void setIndex(int index)
Overrides:
setIndex in interface NodePointer

setPropertyIndex

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

setPropertyName

public void setPropertyName(String propertyName)
Select a property by name
Overrides:
setPropertyName in interface PropertyPointer

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
Overrides:
setValue in interface NodePointer