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
Pointer to a property of a JavaBean.
- See Also:
-
Field Summary
Fields 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
ConstructorsConstructorDescriptionBeanPropertyPointer(NodePointer parent, JXPathBeanInfo beanInfo) Constructs a new BeanPropertyPointer. -
Method Summary
Modifier and TypeMethodDescriptioncreatePath(JXPathContext context) Called by a child pointer when it needs to create a parent object.Gets the value of the currently selected property.If index == WHOLE_COLLECTION, the value of the property, otherwise the value of the index'th element of the collection represented by the property.intIf the property contains a collection, then the length of that collection, otherwise - 1.intCount the number of properties represented.protected PropertyDescriptor[]Gets all PropertyDescriptors.Gets the name of the currently selected property.String[]Gets the names of all properties, sorted alphabetically.protected booleanTests whether this pointer references an actual property.booleanReturnstrueif the value of the pointer is an array or a Collection.booleanThis type of node is auxiliary.voidremove()Remove the node of the object graph this pointer points to.voidsetIndex(int index) Sets the index of this NodePointer.voidsetPropertyIndex(int index) Selects a property by its offset in the alphabetically sorted list.voidsetPropertyName(String propertyName) Select a property by name.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, equals, getBean, getImmediateValuePointer, getName, getPropertyIndex, hashCode, isActual, 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, setNamespaceResolver, testNode, toString, verify
-
Constructor Details
-
BeanPropertyPointer
Constructs a new BeanPropertyPointer.- Parameters:
parent- parent pointerbeanInfo- describes the target property/ies.
-
-
Method Details
-
createPath
Description copied from class:NodePointerCalled 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:
createPathin classPropertyPointer- Parameters:
context- the owning JXPathContext- Returns:
- created NodePointer
-
getBaseValue
Gets the value of the currently selected property.- 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
-
getLength
If the property contains a collection, then the length of that collection, otherwise - 1.- Overrides:
getLengthin classPropertyPointer- Returns:
- int length
-
getPropertyCount
Description copied from class:PropertyPointerCount the number of properties represented.- Specified by:
getPropertyCountin classPropertyPointer- Returns:
- int
-
getPropertyDescriptors
Gets all PropertyDescriptors.- Returns:
- PropertyDescriptor[]
-
getPropertyName
Gets the name of the currently selected property.- Specified by:
getPropertyNamein classPropertyPointer- Returns:
- String property name
-
getPropertyNames
Gets the names of all properties, sorted alphabetically.- Specified by:
getPropertyNamesin classPropertyPointer- Returns:
- String[]
-
isActualProperty
Description copied from class:PropertyPointerTests whether this pointer references an actual property.- Specified by:
isActualPropertyin classPropertyPointer- Returns:
- true if actual
-
isCollection
Description copied from class:NodePointerReturnstrueif the value of the pointer is an array or a Collection.- Overrides:
isCollectionin classPropertyPointer- Returns:
- boolean
-
isContainer
This type of node is auxiliary.- Overrides:
isContainerin classNodePointer- Returns:
- true
-
remove
Description copied from class:NodePointerRemove the node of the object graph this pointer points to.- Overrides:
removein classNodePointer
-
setIndex
Description copied from class:NodePointerSets the index of this NodePointer.- Overrides:
setIndexin classNodePointer- Parameters:
index- int
-
setPropertyIndex
Selects a property by its offset in the alphabetically sorted list.- Overrides:
setPropertyIndexin classPropertyPointer- Parameters:
index- property index
-
setPropertyName
Select a property by name.- Specified by:
setPropertyNamein classPropertyPointer- Parameters:
propertyName- String name
-
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- value to set
-