Class DynaBeanPropertyPointer
- java.lang.Object
-
- org.apache.commons.jxpath.ri.model.NodePointer
-
- org.apache.commons.jxpath.ri.model.beans.PropertyPointer
-
- org.apache.commons.jxpath.ri.model.dynabeans.DynaBeanPropertyPointer
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable,java.lang.Comparable,Pointer
public class DynaBeanPropertyPointer extends PropertyPointer
Pointer pointing to a property of aDynaBean. If the target DynaBean is Serializable, so should this instance be.- Version:
- $Revision: 668329 $ $Date: 2008-06-16 16:59:48 -0500 (Mon, 16 Jun 2008) $
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private org.apache.commons.beanutils.DynaBeandynaBeanprivate java.lang.Stringnameprivate java.lang.String[]namesprivate static longserialVersionUID-
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 DynaBeanPropertyPointer(NodePointer parent, org.apache.commons.beanutils.DynaBean dynaBean)Create a new DynaBeanPropertyPointer.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private java.lang.Objectconvert(java.lang.Object value, boolean element)Convert a value to the appropriate property type.java.lang.ObjectgetBaseValue()Returns the value represented by the pointer before indexing.java.lang.ObjectgetImmediateNode()If index == WHOLE_COLLECTION, the value of the property, otherwise the value of the index'th element of the collection represented by the property.intgetPropertyCount()Count the number of properties represented.intgetPropertyIndex()Index of the currently selected property in the list of all properties sorted alphabetically.java.lang.StringgetPropertyName()Returns the name of the currently selected property or "*" if none has been selected.java.lang.String[]getPropertyNames()Get the names of the included properties.protected booleanisActualProperty()Returns true if the bean has the currently selected property.booleanisContainer()This type of node is auxiliary.protected booleanisIndexedProperty()Learn whether the property referenced is an indexed property.voidremove()Remove the node of the object graph this pointer points to.voidsetPropertyIndex(int index)Index a property by its index in the list of all properties sorted alphabetically.voidsetPropertyName(java.lang.String propertyName)Select a property by name.private voidsetValue(int index, java.lang.Object value)Set an indexed value.voidsetValue(java.lang.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, getImmediateValuePointer, getLength, getName, hashCode, isActual, isCollection, 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, isAttribute, isDefaultNamespace, isLanguage, isNode, isRoot, namespaceIterator, namespacePointer, newChildNodePointer, newNodePointer, printPointerChain, setAttribute, setIndex, setNamespaceResolver, testNode, toString
-
-
-
-
Field Detail
-
dynaBean
private org.apache.commons.beanutils.DynaBean dynaBean
-
name
private java.lang.String name
-
names
private java.lang.String[] names
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
DynaBeanPropertyPointer
public DynaBeanPropertyPointer(NodePointer parent, org.apache.commons.beanutils.DynaBean dynaBean)
Create a new DynaBeanPropertyPointer.- Parameters:
parent- pointerdynaBean- pointed
-
-
Method Detail
-
getBaseValue
public java.lang.Object getBaseValue()
Description copied from class:NodePointerReturns the value represented by the pointer before indexing. So, if the node represents an element of a collection, this method returns the collection itself.- Specified by:
getBaseValuein classNodePointer- Returns:
- Object value
-
isContainer
public boolean isContainer()
This type of node is auxiliary.- Overrides:
isContainerin classNodePointer- Returns:
- true
-
getPropertyCount
public int getPropertyCount()
Description copied from class:PropertyPointerCount the number of properties represented.- Specified by:
getPropertyCountin classPropertyPointer- Returns:
- int
-
getPropertyNames
public java.lang.String[] getPropertyNames()
Description copied from class:PropertyPointerGet the names of the included properties.- Specified by:
getPropertyNamesin classPropertyPointer- Returns:
- String[]
-
getPropertyName
public java.lang.String getPropertyName()
Returns the name of the currently selected property or "*" if none has been selected.- Specified by:
getPropertyNamein classPropertyPointer- Returns:
- String
-
setPropertyName
public void setPropertyName(java.lang.String propertyName)
Select a property by name.- Specified by:
setPropertyNamein classPropertyPointer- Parameters:
propertyName- to select
-
getPropertyIndex
public int getPropertyIndex()
Index of the currently selected property in the list of all properties sorted alphabetically.- Overrides:
getPropertyIndexin classPropertyPointer- Returns:
- int
-
setPropertyIndex
public void setPropertyIndex(int index)
Index a property by its index in the list of all properties sorted alphabetically.- Overrides:
setPropertyIndexin classPropertyPointer- Parameters:
index- to set
-
getImmediateNode
public java.lang.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:
getImmediateNodein classPropertyPointer- Returns:
- Object
-
isActualProperty
protected boolean isActualProperty()
Returns true if the bean has the currently selected property.- Specified by:
isActualPropertyin classPropertyPointer- Returns:
- boolean
-
isIndexedProperty
protected boolean isIndexedProperty()
Learn whether the property referenced is an indexed property.- Returns:
- boolean
-
setValue
public void setValue(java.lang.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:
setValuein interfacePointer- Specified by:
setValuein classNodePointer- Parameters:
value- to set
-
remove
public void remove()
Description copied from class:NodePointerRemove the node of the object graph this pointer points to.- Overrides:
removein classNodePointer
-
setValue
private void setValue(int index, java.lang.Object value)Set an indexed value.- Parameters:
index- to changevalue- to set
-
convert
private java.lang.Object convert(java.lang.Object value, boolean element)Convert a value to the appropriate property type.- Parameters:
value- to convertelement- whether this should be a collection element.- Returns:
- conversion result
-
-