Class TinyNamespaceImpl

  • All Implemented Interfaces:
    NodeInfo, javax.xml.transform.dom.DOMLocator, javax.xml.transform.Source, javax.xml.transform.SourceLocator, org.w3c.dom.Node

    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
    • Constructor Detail

      • TinyNamespaceImpl

        public TinyNamespaceImpl​(TinyDocumentImpl doc,
                                 int nodeNr)
    • Method Detail

      • getNamespaceCode

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

        void setParentNode​(int nodeNr)
        Set the parent element for this namespace node
      • getPrefix

        public java.lang.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 org.w3c.dom.Node
        Specified by:
        getPrefix in interface NodeInfo
        Overrides:
        getPrefix in class TinyNodeImpl
        Returns:
        the prefix part of the name. Always null.
      • getDisplayName

        public java.lang.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 class TinyNodeImpl
        Returns:
        The display name of this node. For a node with no name, return an empty string.
      • getLocalName

        public java.lang.String getLocalName()
        Get the local name of this node. For namespaces this is the namespace prefix.
        Specified by:
        getLocalName in interface org.w3c.dom.Node
        Specified by:
        getLocalName in interface NodeInfo
        Overrides:
        getLocalName in class TinyNodeImpl
        Returns:
        The local name of this node.
      • getURI

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

        public NodeInfo getParent()
        Get the parent element of this namespace node
        Specified by:
        getParent in interface NodeInfo
        Overrides:
        getParent in class TinyNodeImpl
        Returns:
        The Node object describing the containing element or root node.
      • 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 class TinyNodeImpl
        Returns:
        true if this Node object and the supplied Node object represent the same node in the tree.
      • getNodeType

        public final short getNodeType()
        Return the type of node.
        Returns:
        NodeInfo.NAMESPACE
      • getStringValue

        public final java.lang.String getStringValue()
        Return the string value of the node.
        Returns:
        the namespace uri
      • generateId

        public java.lang.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 class TinyNodeImpl
        Returns:
        a string.
      • copy

        public void copy​(Outputter out)
                  throws javax.xml.transform.TransformerException
        Copy this node to a given outputter
        Throws:
        javax.xml.transform.TransformerException
      • 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 class TinyNodeImpl