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

Class CollectionPointer

Implemented Interfaces:
Cloneable, Comparable, Pointer, Serializable
Known Direct Subclasses:
NullElementPointer

public class CollectionPointer
extends NodePointer

Transparent pointer to a collection (array or Collection).
Version:
$Revision: 1.19 $ $Date: 2004/04/04 22:06:35 $
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

CollectionPointer(Object collection, Locale locale)
CollectionPointer(NodePointer parent, Object collection)

Method Summary

String
asPath()
Returns an XPath that maps to this Pointer.
NodeIterator
attributeIterator(QName name)
NodeIterator
childIterator(NodeTest test, boolean reverse, NodePointer startWith)
int
compareChildNodePointers(NodePointer pointer1, NodePointer pointer2)
NodePointer
createChild(JXPathContext context, QName name, int index)
NodePointer
createChild(JXPathContext context, QName name, int index, Object value)
NodePointer
createPath(JXPathContext context)
NodePointer
createPath(JXPathContext context, Object value)
boolean
equals(Object object)
Object
getBaseValue()
Object
getImmediateNode()
int
getLength()
QName
getName()
NodePointer
getValuePointer()
int
hashCode()
boolean
isCollection()
boolean
isContainer()
boolean
isLeaf()
NodeIterator
namespaceIterator()
NodePointer
namespacePointer(String namespace)
void
setIndex(int index)
void
setValue(Object value)
Modifies the value of the object, property or collection element this pointer represents.
boolean
testNode(NodeTest nodeTest)

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

CollectionPointer

public CollectionPointer(Object collection,
                         Locale locale)

CollectionPointer

public CollectionPointer(NodePointer parent,
                         Object collection)

Method Details

asPath

public String asPath()
Returns an XPath that maps to this Pointer.
Specified by:
asPath in interface Pointer
Overrides:
asPath in interface NodePointer

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

createChild

public NodePointer createChild(JXPathContext context,
                               QName name,
                               int index)
Overrides:
createChild in interface NodePointer

createChild

public NodePointer createChild(JXPathContext context,
                               QName name,
                               int index,
                               Object value)
Overrides:
createChild in interface NodePointer

createPath

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

createPath

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

equals

public boolean equals(Object object)

getBaseValue

public Object getBaseValue()
Overrides:
getBaseValue in interface NodePointer

getImmediateNode

public Object getImmediateNode()
Overrides:
getImmediateNode in interface NodePointer

getLength

public int getLength()
Overrides:
getLength in interface NodePointer

getName

public QName getName()
Overrides:
getName in interface NodePointer

getValuePointer

public NodePointer getValuePointer()
Overrides:
getValuePointer in interface NodePointer

hashCode

public int hashCode()

isCollection

public boolean isCollection()
Overrides:
isCollection in interface NodePointer

isContainer

public boolean isContainer()
Overrides:
isContainer in interface NodePointer

isLeaf

public boolean isLeaf()
Overrides:
isLeaf in interface NodePointer

namespaceIterator

public NodeIterator namespaceIterator()
Overrides:
namespaceIterator in interface NodePointer

namespacePointer

public NodePointer namespacePointer(String namespace)
Overrides:
namespacePointer in interface NodePointer

setIndex

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

setValue

public void setValue(Object value)
Modifies the value of the object, property or collection element this pointer represents.
Specified by:
setValue in interface Pointer
Overrides:
setValue in interface NodePointer

testNode

public boolean testNode(NodeTest nodeTest)
Overrides:
testNode in interface NodePointer