org.apache.commons.jxpath.ri.model.beans

Class PropertyOwnerPointer

Implemented Interfaces:
Cloneable, Comparable, Pointer, Serializable
Known Direct Subclasses:
BeanPointer, DynaBeanPointer, DynamicPointer, NullPointer

public abstract class PropertyOwnerPointer
extends NodePointer

A pointer describing a node that has properties, each of which could be a collection.
Version:
$Revision: 1.19 $ $Date: 2004/04/04 22:06:36 $
Author:
Dmitri Plotnikov

Field Summary

Fields inherited from class org.apache.commons.jxpath.ri.model.NodePointer

UNKNOWN_NAMESPACE, WHOLE_COLLECTION, index, locale, parent

Constructor Summary

PropertyOwnerPointer(NodePointer parent)
PropertyOwnerPointer(NodePointer parent, Locale locale)

Method Summary

NodeIterator
attributeIterator(QName name)
NodeIterator
childIterator(NodeTest test, boolean reverse, NodePointer startWith)
int
compareChildNodePointers(NodePointer pointer1, NodePointer pointer2)
NodeIterator
createNodeIterator(String property, boolean reverse, NodePointer startWith)
Object
getImmediateNode()
abstract QName
getName()
abstract PropertyPointer
getPropertyPointer()
boolean
isDynamicPropertyDeclarationSupported()
void
remove()
If this is a root node pointer, throws an exception; otherwise forwards the call to the parent node.
void
setIndex(int index)
void
setValue(Object value)
Throws an exception if you try to change the root element, otherwise forwards the call to the parent pointer.

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

PropertyOwnerPointer

protected PropertyOwnerPointer(NodePointer parent)

PropertyOwnerPointer

protected PropertyOwnerPointer(NodePointer parent,
                               Locale locale)

Method Details

attributeIterator

public NodeIterator attributeIterator(QName name)
Overrides:
attributeIterator in interface NodePointer

childIterator

public NodeIterator childIterator(NodeTest test,
                                  boolean reverse,
                                  NodePointer startWith)
Overrides:
childIterator in interface NodePointer

compareChildNodePointers

public int compareChildNodePointers(NodePointer pointer1,
                                    NodePointer pointer2)
Overrides:
compareChildNodePointers in interface NodePointer

createNodeIterator

public NodeIterator createNodeIterator(String property,
                                       boolean reverse,
                                       NodePointer startWith)

getImmediateNode

public Object getImmediateNode()
Overrides:
getImmediateNode in interface NodePointer

getName

public abstract QName getName()
Overrides:
getName in interface NodePointer

getPropertyPointer

public abstract PropertyPointer getPropertyPointer()

isDynamicPropertyDeclarationSupported

public boolean isDynamicPropertyDeclarationSupported()
Returns:
true if the property owner can set a property "does not exist". A good example is a Map. You can always assign a value to any key even if it has never been "declared".

remove

public void remove()
If this is a root node pointer, throws an exception; otherwise forwards the call to the parent node.
Overrides:
remove in interface NodePointer

setIndex

public void setIndex(int index)
Overrides:
setIndex in interface NodePointer

setValue

public void setValue(Object value)
Throws an exception if you try to change the root element, otherwise forwards the call to the parent pointer.
Specified by:
setValue in interface Pointer
Overrides:
setValue in interface NodePointer