Class XmlNodeChunk

    • Constructor Detail

      • XmlNodeChunk

        protected XmlNodeChunk​(java.nio.ByteBuffer buffer,
                               @Nullable
                               Chunk parent)
    • Method Detail

      • hasComment

        public boolean hasComment()
        Returns true if this XML node contains a comment. Else, returns false.
      • getLineNumber

        public int getLineNumber()
        Returns the line number in the original source at which this node appeared.
      • getComment

        public java.lang.String getComment()
        Returns the comment associated with this node, if any. Else, returns the empty string.
      • getString

        protected java.lang.String getString​(int index)
        An XmlNodeChunk does not know by itself what strings its indices reference. In order to get the actual string, the first XmlChunk ancestor is found. The XmlChunk ancestor should have a string pool which index references.
        Parameters:
        index - The index of the string.
        Returns:
        String that the given index references, or empty string if index is -1.
      • writeHeader

        protected final void writeHeader​(java.nio.ByteBuffer output)
        An XmlNodeChunk and anything that is itself an XmlNodeChunk has a header size of 16. Anything else is, interestingly, considered to be a payload. For that reason, this method is final.
        Overrides:
        writeHeader in class Chunk
        Parameters:
        output - The buffer that the header will be written to.
      • toString

        public java.lang.String toString()
        Returns a brief description of this XML node. The representation of this information is subject to change, but below is a typical example:
        "XmlNodeChunk{line=1234, comment=My awesome comment.}"
        Overrides:
        toString in class java.lang.Object