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

Class NullElementPointer

Implemented Interfaces:
Cloneable, Comparable, Pointer, Serializable

public class NullElementPointer
extends CollectionPointer

Used when there is a need to construct a Pointer for a collection element that does not exist. For example, if the path is "foo[3]", but the collection "foo" only has one element or is empty or is null, the NullElementPointer can be used to capture this situation without putting a regular NodePointer into an invalid state. Just create a NullElementPointer with index 2 (= 3 - 1) and a "foo" pointer as the parent.
Version:
$Revision: 1.17 $ $Date: 2004/03/25 03:49:50 $
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

NullElementPointer(NodePointer parent, int index)

Method Summary

String
asPath()
NodePointer
createPath(JXPathContext context)
NodePointer
createPath(JXPathContext context, Object value)
boolean
equals(Object object)
Object
getBaseValue()
Object
getImmediateNode()
int
getLength()
QName
getName()
PropertyPointer
getPropertyPointer()
NodePointer
getValuePointer()
int
hashCode()
boolean
isActual()
boolean
isCollection()
boolean
isContainer()
boolean
isLeaf()
void
setValue(Object value)

Methods inherited from class org.apache.commons.jxpath.ri.model.beans.CollectionPointer

asPath, attributeIterator, childIterator, compareChildNodePointers, createChild, createChild, createPath, createPath, equals, getBaseValue, getImmediateNode, getLength, getName, getValuePointer, hashCode, isCollection, isContainer, isLeaf, namespaceIterator, namespacePointer, setIndex, setValue, testNode

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

NullElementPointer

public NullElementPointer(NodePointer parent,
                          int index)

Method Details

asPath

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

createPath

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

createPath

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

equals

public boolean equals(Object object)
Overrides:
equals in interface CollectionPointer

getBaseValue

public Object getBaseValue()
Overrides:
getBaseValue in interface CollectionPointer

getImmediateNode

public Object getImmediateNode()
Overrides:
getImmediateNode in interface CollectionPointer

getLength

public int getLength()
Overrides:
getLength in interface CollectionPointer

getName

public QName getName()
Overrides:
getName in interface CollectionPointer

getPropertyPointer

public PropertyPointer getPropertyPointer()

getValuePointer

public NodePointer getValuePointer()
Overrides:
getValuePointer in interface CollectionPointer

hashCode

public int hashCode()
Overrides:
hashCode in interface CollectionPointer

isActual

public boolean isActual()
Overrides:
isActual in interface NodePointer

isCollection

public boolean isCollection()
Overrides:
isCollection in interface CollectionPointer

isContainer

public boolean isContainer()
Overrides:
isContainer in interface CollectionPointer

isLeaf

public boolean isLeaf()
Overrides:
isLeaf in interface CollectionPointer

setValue

public void setValue(Object value)
Specified by:
setValue in interface Pointer
Overrides:
setValue in interface CollectionPointer