com.icl.saxon.tinytree

Class TinyNamespaceImpl

Implemented Interfaces:
DOMLocator, Node, NodeInfo, Source, SourceLocator

(package private) final class TinyNamespaceImpl
extends TinyNodeImpl

A node in the XML parse tree representing a Namespace. Note that this is generated only "on demand", when the namespace axis is expanded.

Version:
28 September 2000
Author:
Michael H. Kay

Field Summary

Fields inherited from class com.icl.saxon.tinytree.TinyNodeImpl

document, nodeNr, parent

Fields inherited from class com.icl.saxon.om.AbstractNode

NODE_LETTER

Fields inherited from interface com.icl.saxon.om.NodeInfo

ATTRIBUTE, COMMENT, ELEMENT, NAMESPACE, NODE, NONE, NUMBER_OF_TYPES, PI, ROOT, TEXT

Constructor Summary

TinyNamespaceImpl(TinyDocumentImpl doc, int nodeNr)

Method Summary

void
copy(Outputter out)
Copy this node to a given outputter
String
generateId()
Get unique identifier.
String
getDisplayName()
Get the display name of this node.
int
getFingerprint()
Get the fingerprint
String
getLocalName()
Get the local name of this node.
int
getNameCode()
Get the nameCode, for name matching
int
getNamespaceCode()
Get the namespace code (a numeric representation of the prefix and URI)
short
getNodeType()
Return the type of node.
NodeInfo
getParent()
Get the parent element of this namespace node
String
getPrefix()
Get the prefix part of the name of this node.
protected long
getSequenceNumber()
Get the node sequence number (in document order).
String
getStringValue()
Return the string value of the node.
String
getURI()
Get the URI part of the name of this node.
boolean
isSameNodeInfo(NodeInfo other)
Determine whether this is the same node as another node
(package private) void
setParentNode(int nodeNr)
Set the parent element for this namespace node

Methods inherited from class com.icl.saxon.tinytree.TinyNodeImpl

compareOrder, generateId, getAttributeValue, getAttributeValue, getBaseURI, getDisplayName, getDocumentRoot, getEnumeration, getFingerprint, getLineNumber, getLocalName, getNameCode, getOriginatingNode, getParent, getPrefix, getSequenceNumber, getSystemId, getURI, hasAttributes, hasChildNodes, isSameNodeInfo, outputNamespaceNodes, setLineNumber, setParentNode, setSystemId

Methods inherited from class com.icl.saxon.om.AbstractNode

appendChild, appendData, cloneNode, compareDocumentPosition, compareOrder, copyStringValue, createAttribute, createAttributeNS, createCDATASection, createComment, createDocumentFragment, createElement, createElementNS, createEntityReference, createProcessingInstruction, createTextNode, deleteData, disallowUpdate, generateId, getAttribute, getAttributeNS, getAttributeNode, getAttributeNodeNS, getAttributeValue, getAttributeValue, getAttributes, getBaseURI, getChildNodes, getColumnNumber, getData, getDisplayName, getDoctype, getDocumentElement, getDocumentRoot, getElementById, getElementsByTagName, getElementsByTagNameNS, getEnumeration, getFeature, getFingerprint, getFirstChild, getImplementation, getLastChild, getLength, getLineNumber, getLocalName, getName, getNameCode, getNamespaceURI, getNextSibling, getNodeName, getNodeValue, getOriginatingNode, getOwnerDocument, getOwnerElement, getParent, getParentNode, getPrefix, getPreviousSibling, getPublicId, getSchemaTypeInfo, getSpecified, getSystemId, getTagName, getTextContent, getURI, getUserData, getValue, getWholeText, hasAttribute, hasAttributeNS, hasAttributes, hasChildNodes, importNode, insertBefore, insertData, isDefaultNamespace, isElementContentWhitespace, isEqualNode, isId, isSameNode, isSameNodeInfo, isSupported, lookupNamespaceURI, lookupPrefix, normalize, outputNamespaceNodes, removeAttribute, removeAttributeNS, removeAttributeNode, removeChild, replaceChild, replaceData, replaceWholeText, setAttributeNS, setAttributeNode, setAttributeNodeNS, setData, setIdAttribute, setIdAttributeNS, setIdAttributeNode, setNodeValue, setPrefix, setTextContent, setUserData, setValue, splitText, substringData, supports

Constructor Details

TinyNamespaceImpl

public TinyNamespaceImpl(TinyDocumentImpl doc,
                         int nodeNr)

Method Details

copy

public void copy(Outputter out)
            throws TransformerException
Copy this node to a given outputter
Specified by:
copy in interface NodeInfo

generateId

public String generateId()
Get unique identifier. Returns key of owning element with the name fingerprint as a suffix
Specified by:
generateId in interface NodeInfo
Overrides:
generateId in interface TinyNodeImpl

getDisplayName

public String getDisplayName()
Get the display name of this node. For namespaces this is the namespace prefix.
Specified by:
getDisplayName in interface NodeInfo
Overrides:
getDisplayName in interface TinyNodeImpl
Returns:
The display name of this node. For a node with no name, return an empty string.

getFingerprint

public int getFingerprint()
Get the fingerprint
Specified by:
getFingerprint in interface NodeInfo
Overrides:
getFingerprint in interface TinyNodeImpl

getLocalName

public String getLocalName()
Get the local name of this node. For namespaces this is the namespace prefix.
Specified by:
getLocalName in interface NodeInfo
Overrides:
getLocalName in interface TinyNodeImpl
Returns:
The local name of this node.

getNameCode

public int getNameCode()
Get the nameCode, for name matching
Specified by:
getNameCode in interface NodeInfo
Overrides:
getNameCode in interface TinyNodeImpl

getNamespaceCode

public int getNamespaceCode()
Get the namespace code (a numeric representation of the prefix and URI)

getNodeType

public final short getNodeType()
Return the type of node.
Specified by:
getNodeType in interface NodeInfo
Returns:
NodeInfo.NAMESPACE

getParent

public NodeInfo getParent()
Get the parent element of this namespace node
Specified by:
getParent in interface NodeInfo
Overrides:
getParent in interface TinyNodeImpl

getPrefix

public String getPrefix()
Get the prefix part of the name of this node. This is the name before the ":" if any.
Specified by:
getPrefix in interface NodeInfo
Overrides:
getPrefix in interface TinyNodeImpl
Returns:
the prefix part of the name. Always null.

getSequenceNumber

protected long getSequenceNumber()
Get the node sequence number (in document order). Sequence numbers are monotonic but not consecutive. In the current implementation, parent nodes (elements and roots) have a zero least-significant word, while namespaces, attributes, text nodes, comments, and PIs have the top word the same as their owner and the bottom half reflecting their relative position.
Overrides:
getSequenceNumber in interface TinyNodeImpl

getStringValue

public final String getStringValue()
Return the string value of the node.
Specified by:
getStringValue in interface NodeInfo
Returns:
the namespace uri

getURI

public String getURI()
Get the URI part of the name of this node.
Specified by:
getURI in interface NodeInfo
Overrides:
getURI in interface TinyNodeImpl
Returns:
The URI of the namespace of this node. Always null.

isSameNodeInfo

public final boolean isSameNodeInfo(NodeInfo other)
Determine whether this is the same node as another node
Specified by:
isSameNodeInfo in interface NodeInfo
Overrides:
isSameNodeInfo in interface TinyNodeImpl
Returns:
true if this Node object and the supplied Node object represent the same node in the tree.

setParentNode

(package private)  void setParentNode(int nodeNr)
Set the parent element for this namespace node