Class DynamicPropertyPointer
java.lang.Object
org.apache.commons.jxpath.ri.model.NodePointer
org.apache.commons.jxpath.ri.model.beans.PropertyPointer
org.apache.commons.jxpath.ri.model.dynamic.DynamicPropertyPointer
- All Implemented Interfaces:
Serializable,Cloneable,Comparable,Pointer
Pointer to a property of an object with dynamic properties.
- 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
ConstructorsConstructorDescriptionDynamicPropertyPointer(NodePointer parent, DynamicPropertyHandler handler) Constructs a new DynamicPropertyPointer. -
Method Summary
Modifier and TypeMethodDescriptionasPath()Returns an XPath that maps to this Pointer.createPath(JXPathContext context) Called by a child pointer when it needs to create a parent object.createPath(JXPathContext context, Object value) Called directly by JXPathContext.Returns the value of the property, not an element of the collection represented by the property, if any.If index == WHOLE_COLLECTION, the value of the property, otherwise the value of the index'th element of the collection represented by the property.intNumber of the DP object's properties.intIndex of the currently selected property in the list of all properties sorted alphabetically.Gets the name of the currently selected property or "*" if none has been selected.String[]Gets the names of all properties, sorted alphabetically.protected booleanA dynamic property is always considered actual - all keys are apparently existing with possibly the value of null.booleanThis type of node is auxiliary.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.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, equals, getBean, getImmediateValuePointer, getLength, getName, hashCode, isActual, isCollection, isLeafMethods inherited from class org.apache.commons.jxpath.ri.model.NodePointer
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
-
Constructor Details
-
DynamicPropertyPointer
Constructs a new DynamicPropertyPointer.- Parameters:
parent- pointerhandler- DynamicPropertyHandler
-
-
Method Details
-
asPath
Description copied from class:NodePointerReturns an XPath that maps to this Pointer.- Specified by:
asPathin interfacePointer- Overrides:
asPathin classNodePointer- Returns:
- String XPath expression
-
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
-
createPath
Description copied from class:NodePointerCalled directly by JXPathContext. Must create path and set value.- Overrides:
createPathin classPropertyPointer- Parameters:
context- the owning JXPathContextvalue- the new value to set- Returns:
- created NodePointer
-
getBaseValue
Returns the value of the property, not an element of the collection represented by the property, if any.- Specified by:
getBaseValuein classNodePointer- Returns:
- 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
-
getPropertyCount
Number of the DP object's properties.- Specified by:
getPropertyCountin classPropertyPointer- Returns:
- int
-
getPropertyIndex
Index of the currently selected property in the list of all properties sorted alphabetically.- Overrides:
getPropertyIndexin classPropertyPointer- Returns:
- int
-
getPropertyName
Gets the name of the currently selected property or "*" if none has been selected.- Specified by:
getPropertyNamein classPropertyPointer- Returns:
- String
-
getPropertyNames
Gets the names of all properties, sorted alphabetically.- Specified by:
getPropertyNamesin classPropertyPointer- Returns:
- String[]
-
isActualProperty
A dynamic property is always considered actual - all keys are apparently existing with possibly the value of null.- Specified by:
isActualPropertyin 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
-
setPropertyIndex
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. If the supplied name is not one of the object's existing properties, it implicitly adds this name to the object's property name list. It does not set the property value though. In order to set the property value, call setValue().- Specified by:
setPropertyNamein classPropertyPointer- Parameters:
propertyName- 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
-