public class NodeWrapper extends Object implements NodeInfo
This is the top class in the interface hierarchy for nodes; see NodeImpl for the implementation hierarchy.
| Modifier and Type | Field and Description |
|---|---|
protected DocumentWrapper |
docWrapper |
protected int |
index |
protected Object |
node |
protected short |
nodeType |
protected NodeWrapper |
parent |
| Constructor and Description |
|---|
NodeWrapper(Object node,
NodeWrapper parent,
int index) |
| Modifier and Type | Method and Description |
|---|---|
int |
compareOrder(NodeInfo other)
Determine the relative position of this node and another node, in document order.
|
void |
copy(Outputter out)
Copy this node to a given outputter (deep copy)
|
void |
copyStringValue(Outputter out)
Copy the string-value of this node to a given outputter
|
String |
generateId()
Get a character string that uniquely identifies this node.
Note: a.isSameNode(b) if and only if generateId(a)==generateId(b) |
String |
getAttributeValue(int fingerprint)
Get the value of a given attribute of this node
|
String |
getAttributeValue(String uri,
String localName)
Find the value of a given attribute of this node.
|
String |
getBaseURI()
Get the Base URI for the node, that is, the URI used for resolving a relative URI contained
in the node.
|
String |
getDisplayName()
Get the display name of this node.
|
DocumentInfo |
getDocumentRoot()
Get the root (document) node
|
AxisEnumeration |
getEnumeration(byte axisNumber,
NodeTest nodeTest)
Return an enumeration over the nodes reached by the given axis from this node
|
int |
getFingerprint()
Get fingerprint.
|
int |
getLineNumber()
Get line number
|
String |
getLocalName()
Get the local part of the name of this node.
|
int |
getNameCode()
Get name code.
|
Object |
getNode()
Get the underlying JDOM node
|
short |
getNodeType()
Return the type of node.
|
NodeInfo |
getParent()
Get the NodeInfo object representing the parent of this node
|
String |
getPrefix()
Get the prefix part of the name of this node.
|
String |
getStringValue()
Return the string value of the node.
|
String |
getSystemId()
Get the System ID for the node.
|
String |
getURI()
Get the URI part of the name of this node.
|
boolean |
hasChildNodes()
Determine whether the node has any children.
|
boolean |
isSameNodeInfo(NodeInfo other)
Determine whether this is the same node as another node.
|
NodeWrapper |
makeWrapper(Object node,
NodeWrapper parent,
int index) |
void |
outputNamespaceNodes(Outputter out,
boolean includeAncestors)
Output all namespace nodes associated with this element.
|
void |
setSystemId(String uri) |
protected Object node
protected short nodeType
protected NodeWrapper parent
protected DocumentWrapper docWrapper
protected int index
public NodeWrapper(Object node, NodeWrapper parent, int index)
public NodeWrapper makeWrapper(Object node, NodeWrapper parent, int index)
public Object getNode()
public short getNodeType()
getNodeType in interface NodeInfopublic boolean isSameNodeInfo(NodeInfo other)
isSameNodeInfo in interface NodeInfopublic String getSystemId()
getSystemId in interface NodeInfogetSystemId in interface Sourcepublic void setSystemId(String uri)
setSystemId in interface Sourcepublic String getBaseURI()
getBaseURI in interface NodeInfopublic int getLineNumber()
getLineNumber in interface NodeInfopublic int compareOrder(NodeInfo other)
compareOrder in interface NodeInfoother - The other node, whose position is to be compared with this nodepublic String getStringValue()
getStringValue in interface NodeInfopublic int getNameCode()
getNameCode in interface NodeInfoallocatepublic int getFingerprint()
getFingerprint in interface NodeInfopublic String getLocalName()
getLocalName in interface NodeInfopublic String getPrefix()
public String getURI()
public String getDisplayName()
getDisplayName in interface NodeInfopublic NodeInfo getParent()
public AxisEnumeration getEnumeration(byte axisNumber, NodeTest nodeTest)
getEnumeration in interface NodeInfonodeTest - the type(s) of node to be included, e.g. NodeInfo.ELEMENT, NodeInfo.TEXT.
The value NodeInfo.NODE means include any type of node.nodeTest - A pattern to be matched by the returned nodesaxisNumber - the axis to be followed (a constant in class Axis)public String getAttributeValue(String uri, String localName)
getAttributeValue in interface NodeInfouri - the namespace uri of an attribute ("" if no namespace)localName - the local name of the attributepublic String getAttributeValue(int fingerprint)
getAttributeValue in interface NodeInfofingerprint - The fingerprint of the attribute namepublic DocumentInfo getDocumentRoot()
getDocumentRoot in interface NodeInfopublic boolean hasChildNodes()
hasChildNodes in interface NodeInfopublic String generateId()
generateId in interface NodeInfopublic void copy(Outputter out) throws TransformerException
copy in interface NodeInfoTransformerExceptionpublic void copyStringValue(Outputter out) throws TransformerException
copyStringValue in interface NodeInfoTransformerExceptionpublic void outputNamespaceNodes(Outputter out, boolean includeAncestors) throws TransformerException
outputNamespaceNodes in interface NodeInfoout - The relevant outputterincludeAncestors - True if namespaces declared on ancestor elements must
be output; false if it is known that these are already on the result treeTransformerException