org.apache.commons.jxpath.ri.model.jdom

Class JDOMNodePointer

Implemented Interfaces:
Cloneable, Comparable, Pointer, Serializable

public class JDOMNodePointer
extends NodePointer

A Pointer that points to a DOM node.
Version:
$Revision: 1.17 $ $Date: 2004/06/29 22:58:18 $
Author:
Dmitri Plotnikov

Field Summary

static String
XMLNS_NAMESPACE_URI
static String
XML_NAMESPACE_URI

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

UNKNOWN_NAMESPACE, WHOLE_COLLECTION, index, locale, parent

Constructor Summary

JDOMNodePointer(Object node, Locale locale)
JDOMNodePointer(Object node, Locale locale, String id)
JDOMNodePointer(NodePointer parent, Object node)

Method Summary

String
asPath()
NodeIterator
attributeIterator(QName name)
NodeIterator
childIterator(NodeTest test, boolean reverse, NodePointer startWith)
int
compareChildNodePointers(NodePointer pointer1, NodePointer pointer2)
NodePointer
createAttribute(JXPathContext context, QName name)
NodePointer
createChild(JXPathContext context, QName name, int index)
NodePointer
createChild(JXPathContext context, QName name, int index, Object value)
boolean
equals(Object object)
Object
getBaseValue()
Object
getImmediateNode()
protected String
getLanguage()
int
getLength()
static String
getLocalName(Object node)
QName
getName()
String
getNamespaceURI()
String
getNamespaceURI(String prefix)
static String
getPrefix(Object node)
Object
getValue()
int
hashCode()
boolean
isCollection()
boolean
isLanguage(String lang)
Returns true if the xml:lang attribute for the current node or its parent has the specified prefix lang.
boolean
isLeaf()
NodeIterator
namespaceIterator()
NodePointer
namespacePointer(String prefix)
void
remove()
void
setValue(Object value)
boolean
testNode(NodeTest test)
static boolean
testNode(NodePointer pointer, Object node, NodeTest test)

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

Field Details

XMLNS_NAMESPACE_URI

public static final String XMLNS_NAMESPACE_URI

XML_NAMESPACE_URI

public static final String XML_NAMESPACE_URI

Constructor Details

JDOMNodePointer

public JDOMNodePointer(Object node,
                       Locale locale)

JDOMNodePointer

public JDOMNodePointer(Object node,
                       Locale locale,
                       String id)

JDOMNodePointer

public JDOMNodePointer(NodePointer parent,
                       Object node)

Method Details

asPath

public String asPath()
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

createAttribute

public NodePointer createAttribute(JXPathContext context,
                                   QName name)
Overrides:
createAttribute 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

equals

public boolean equals(Object object)

getBaseValue

public Object getBaseValue()
Overrides:
getBaseValue in interface NodePointer

getImmediateNode

public Object getImmediateNode()
Overrides:
getImmediateNode in interface NodePointer

getLanguage

protected String getLanguage()

getLength

public int getLength()
Overrides:
getLength in interface NodePointer

getLocalName

public static String getLocalName(Object node)

getName

public QName getName()
Overrides:
getName in interface NodePointer

getNamespaceURI

public String getNamespaceURI()
Overrides:
getNamespaceURI in interface NodePointer

getNamespaceURI

public String getNamespaceURI(String prefix)
Overrides:
getNamespaceURI in interface NodePointer

getPrefix

public static String getPrefix(Object node)

getValue

public Object getValue()
Specified by:
getValue in interface Pointer
Overrides:
getValue in interface NodePointer

hashCode

public int hashCode()

isCollection

public boolean isCollection()
Overrides:
isCollection in interface NodePointer

isLanguage

public boolean isLanguage(String lang)
Returns true if the xml:lang attribute for the current node or its parent has the specified prefix lang. If no node has this prefix, calls super.isLanguage(lang).
Overrides:
isLanguage 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 prefix)
Overrides:
namespacePointer in interface NodePointer

remove

public void remove()
Overrides:
remove in interface NodePointer

setValue

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

testNode

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

testNode

public static boolean testNode(NodePointer pointer,
                               Object node,
                               NodeTest test)