Interface AuthorNode

  • All Known Subinterfaces:
    AuthorDocument, AuthorElement, AuthorElementBaseInterface, AuthorParentNode, AuthorReferenceNode

    @API(type=NOT_EXTENDABLE,
         src=PUBLIC)
    public interface AuthorNode
    Base interface for all Author nodes. The Author nodes model is similar with the DOM model with the difference that the TEXT nodes do not exists in this model. The text from the document is kept separately into a data structure similar to Content from Swing. The nodes have start and end pointers into the Content, see getStartOffset() and getEndOffset() methods.
    The author content contains the entire XML document text and special marker characters. Each author node points in the content to the start and end marker characters which are used to delimit it's range.
    Author document fragment architecture.
    The image represents part of the document content and red markers represent special control characters which represent the node ranges.
    • Field Detail

      • NODE_TYPE_ELEMENT

        static final int NODE_TYPE_ELEMENT
        Element node type. The value is 0.
        See Also:
        Constant Field Values
      • NODE_TYPE_TEXT

        static final int NODE_TYPE_TEXT
        Text node type. The value is 1.
        See Also:
        Constant Field Values
      • NODE_TYPE_DOCUMENT

        static final int NODE_TYPE_DOCUMENT
        Document node type. The value is 2.
        See Also:
        Constant Field Values
      • NODE_TYPE_COMMENT

        static final int NODE_TYPE_COMMENT
        Comment node type. The value is 3.
        See Also:
        Constant Field Values
      • NODE_TYPE_CDATA

        static final int NODE_TYPE_CDATA
        CDATA node type. The value is 4.
        See Also:
        Constant Field Values
      • NODE_TYPE_PI

        static final int NODE_TYPE_PI
        Processing instruction node type. The value is 5.
        See Also:
        Constant Field Values
      • NODE_TYPE_PSEUDO_ELEMENT

        static final int NODE_TYPE_PSEUDO_ELEMENT
        Pseudo element node type. The value is 6.
        See Also:
        Constant Field Values
      • NODE_TYPE_REFERENCE

        static final int NODE_TYPE_REFERENCE
        Reference node type (entity or other reference nodes, e.g. xinclude elements). The value is 7.
        See Also:
        Constant Field Values
      • NODE_TYPE_PSEUDO_DOCTYPE

        static final int NODE_TYPE_PSEUDO_DOCTYPE
        Pseudo DOCTYPE node type. The value is 8.
        See Also:
        Constant Field Values
      • NODE_NAME_CDATA

        static final java.lang.String NODE_NAME_CDATA
        Name of CDATA node. The value is #cdata.
        See Also:
        Constant Field Values
      • NODE_NAME_COMMENT

        static final java.lang.String NODE_NAME_COMMENT
        Name of COMMENT node. The value is #comment.
        See Also:
        Constant Field Values
      • NODE_NAME_DOCUMENT

        static final java.lang.String NODE_NAME_DOCUMENT
        Name of DOCUMENT node. The value is #document.
        See Also:
        Constant Field Values
      • NODE_NAME_PI

        static final java.lang.String NODE_NAME_PI
        Name of PI node. The value is processing-instruction.
        See Also:
        Constant Field Values
      • NODE_NAME_REFERENCE

        static final java.lang.String NODE_NAME_REFERENCE
        Name of the reference node.
        See Also:
        Constant Field Values
    • Method Detail

      • getOwnerDocument

        AuthorDocument getOwnerDocument()
        Returns the document to which this element belongs.
        Returns:
        The AuthorDocument to which this element belongs. Returns null if this element is part of a document fragment. For more details see AuthorDocumentFragment.
      • isDescendentOf

        boolean isDescendentOf​(AuthorNode ancestor)
        See if this node is a descendant of the given node.
        Parameters:
        ancestor - The AuthorNode tested to see if it is an ancestor of this node.
        Returns:
        true if the given node is an ancestor of this node.
      • getStartOffset

        int getStartOffset()
        Returns the offset in the content which marks the start of the node's range.
        The author content contains the entire XML document text and special marker characters. Each author node points in the content to the start and end marker characters which are used to delimit it's range.
        Author document fragment architecture.
        The image represents part of the document content and red markers represent special control characters which represent the node ranges.
        Returns:
        The offset into the content corresponding to the start of the node, 0 based and inclusive.
      • getEndOffset

        int getEndOffset()
        Returns the offset in the content which marks the end of the node's range.
        The author content contains the entire XML document text and special marker characters. Each author node points in the content to the start and end marker characters which are used to delimit it's range.
        Author document fragment architecture.
        The image represents part of the document content and red markers represent special control characters which represent the node ranges.
        Returns:
        The offset into the content corresponding to the end of the node, 0 based and inclusive.
      • getParent

        AuthorNode getParent()
        Returns:
        The AuthorNode representing the parent of this element, or null if this is the document node.
      • getDisplayName

        java.lang.String getDisplayName()
        Returns the display name of the node used for visual representation.
        Returns:
        The display name.
      • getXMLBaseURL

        java.net.URL getXMLBaseURL()
        The returned URL represents the value of base URL in the current nodes context. It is resolved taking into account the values of all the 'xml:base' attributes from the ancestors and the document URL if necessary.

        If no 'xml:base' attribute is present, the document system ID will be returned. See specification: http://www.w3.org/TR/xmlbase/.

        Returns:
        The XML base URL.
      • getTextContent

        java.lang.String getTextContent()
                                 throws javax.swing.text.BadLocationException
        Returns the nodes text content. The returned value is obtained by adding all the descendants text content.
        Returns:
        The node text content.
        Throws:
        javax.swing.text.BadLocationException - If the text content cannot be obtained.
      • getContentIterator

        ContentIterator getContentIterator()

        Return an iterator over the text content of this node.

        The content may contain special characters which have the value equal to 0. These special characters are the markers for content referenced by descendant nodes.

        More about how Author Nodes point to the content:
        Author document fragment architecture.

        Returns:
        an iterator over the text content of this node.
        Since:
        22
      • getNamespace

        java.lang.String getNamespace()
        Returns:
        The node's namespace
      • getNamespaceContext

        NamespaceContext getNamespaceContext()
        Obtain access to the mappings from prefix to namespace and from namespace to prefix in the context of the current element.
        Returns:
        mappings from prefix to namespace and from namespace to prefix in the context of the current element.
        Since:
        13