org.apache.commons.jxpath.ri.model.dynamic

Class DynamicPropertyPointer

Implemented Interfaces:
Cloneable, Comparable, Pointer, Serializable

public class DynamicPropertyPointer
extends PropertyPointer

Pointer pointing to a property of an object with dynamic properties.
Version:
$Revision: 1.8 $ $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

DynamicPropertyPointer(NodePointer parent, DynamicPropertyHandler handler)

Method Summary

String
asPath()
NodePointer
createPath(JXPathContext context)
NodePointer
createPath(JXPathContext context, Object value)
Object
getBaseValue()
Returns the value of the property, not an element of the collection represented by the property, if any.
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
getPropertyCount()
Number of the DP object's properties.
int
getPropertyIndex()
Index of the currently selected property in the list of all properties sorted alphabetically.
String
getPropertyName()
Returns the name of the currently selected property or "*" if none has been selected.
String[]
getPropertyNames()
Names of all properties, sorted alphabetically
protected boolean
isActualProperty()
A dynamic property is always considered actual - all keys are apparently existing with possibly the value of null.
boolean
isContainer()
This type of node is auxiliary.
void
remove()
void
setPropertyIndex(int index)
Index a property by its index in the list of all properties sorted alphabetically.
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

DynamicPropertyPointer

public DynamicPropertyPointer(NodePointer parent,
                              DynamicPropertyHandler handler)

Method Details

asPath

public String asPath()
Specified by:
asPath in interface Pointer
Overrides:
asPath in interface NodePointer

createPath

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

createPath

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

getBaseValue

public Object getBaseValue()
Returns the value of the property, not an element of the collection represented by the property, if any.
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

getPropertyCount

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

getPropertyIndex

public int getPropertyIndex()
Index of the currently selected property in the list of all properties sorted alphabetically.
Overrides:
getPropertyIndex in interface PropertyPointer

getPropertyName

public String getPropertyName()
Returns the name of the currently selected property or "*" if none has been selected.
Overrides:
getPropertyName in interface PropertyPointer

getPropertyNames

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

isActualProperty

protected boolean isActualProperty()
A dynamic property is always considered actual - all keys are apparently existing with possibly the value of null.
Overrides:
isActualProperty 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

setPropertyIndex

public void setPropertyIndex(int index)
Index a property by its index in the list of all properties sorted alphabetically.
Overrides:
setPropertyIndex in interface PropertyPointer

setPropertyName

public void setPropertyName(String propertyName)
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().
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