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:
Serializable,Cloneable,Comparable,Pointer
Pointer to a property of a
DynaBean. If the target DynaBean is Serializable, so should this instance be.- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final Stringprivate final org.apache.commons.beanutils.DynaBeanDynaBean.private StringThe name of the currently selected property or "*" if none has been selected.private String[]The names of the included properties.private static final longFields inherited from class org.apache.commons.jxpath.ri.model.beans.PropertyPointer
bean, propertyIndex, UNSPECIFIED_PROPERTYFields inherited from class org.apache.commons.jxpath.ri.model.NodePointer
index, locale, parent, UNKNOWN_NAMESPACE, WHOLE_COLLECTION -
Constructor Summary
ConstructorsConstructorDescriptionDynaBeanPropertyPointer(NodePointer parent, org.apache.commons.beanutils.DynaBean dynaBean) Constructs a new DynaBeanPropertyPointer. -
Method Summary
Modifier and TypeMethodDescriptionprivate ObjectConvert a value to the appropriate property type.Gets the value represented by the pointer before indexing.If index == WHOLE_COLLECTION, the value of the property, otherwise the value of the index'th element of the collection represented by the property.intCount the number of properties represented.intIndex of the currently selected property in the list of all properties sorted alphabetically.Returns the name of the currently selected property or "*" if none has been selected.String[]Gets the names of the included properties.protected booleanReturns true if the bean has the currently selected property.booleanThis type of node is auxiliary.protected booleanTests 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(String propertyName) Select a property by name.private voidSets an indexed value.voidIf 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, isLeafMethods 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, setIndex, setNamespaceResolver, testNode, toString, verify
-
Field Details
-
CLASS
- See Also:
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
dynaBean
private final org.apache.commons.beanutils.DynaBean dynaBeanDynaBean. -
name
The name of the currently selected property or "*" if none has been selected. -
names
The names of the included properties.
-
-
Constructor Details
-
DynaBeanPropertyPointer
Constructs a new DynaBeanPropertyPointer.- Parameters:
parent- pointerdynaBean- pointed
-
-
Method Details
-
convert
Convert a value to the appropriate property type.- Parameters:
value- to convertelement- whether this should be a collection element.- Returns:
- conversion result
-
getBaseValue
Description copied from class:NodePointerGets 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
-
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
-
getPropertyCount
public int getPropertyCount()Description copied from class:PropertyPointerCount the number of properties represented.- Specified by:
getPropertyCountin classPropertyPointer- Returns:
- int
-
getPropertyIndex
public int getPropertyIndex()Index of the currently selected property in the list of all properties sorted alphabetically.- Overrides:
getPropertyIndexin classPropertyPointer- Returns:
- int
-
getPropertyName
Returns the name of the currently selected property or "*" if none has been selected.- Specified by:
getPropertyNamein classPropertyPointer- Returns:
- String
-
getPropertyNames
Description copied from class:PropertyPointerGets the names of the included properties.- Specified by:
getPropertyNamesin classPropertyPointer- Returns:
- String[]
-
isActualProperty
protected boolean isActualProperty()Returns true if the bean has the currently selected property.- Specified by:
isActualPropertyin classPropertyPointer- Returns:
- boolean
-
isContainer
public boolean isContainer()This type of node is auxiliary.- Overrides:
isContainerin classNodePointer- Returns:
- true
-
isIndexedProperty
protected boolean isIndexedProperty()Tests whether the property referenced is an indexed property.- Returns:
- boolean
-
remove
public void remove()Description copied from class:NodePointerRemove the node of the object graph this pointer points to.- Overrides:
removein classNodePointer
-
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
-
setPropertyName
Select a property by name.- Specified by:
setPropertyNamein classPropertyPointer- Parameters:
propertyName- to select
-
setValue
Sets an indexed value.- Parameters:
index- to changevalue- to set
-
setValue
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
-