Class Document


  • public class Document
    extends Node
    The document consists of some legacy events and a single root element. This class basically adds some consistency checks to Node.
    • Field Detail

      • rootIndex

        protected int rootIndex
    • Constructor Detail

      • Document

        public Document()
    • Method Detail

      • getEncoding

        public String getEncoding()
        returns "#document"
      • setEncoding

        public void setEncoding​(String enc)
      • setStandalone

        public void setStandalone​(Boolean standalone)
      • getStandalone

        public Boolean getStandalone()
      • getName

        public String getName()
      • addChild

        public void addChild​(int index,
                             int type,
                             Object child)
        Adds a child at the given index position. Throws an exception when a second root element is added
        Overrides:
        addChild in class Node
      • removeChild

        public void removeChild​(int index)
        Description copied from class: Node
        Removes the child object at the given index
        Overrides:
        removeChild in class Node
      • getRootElement

        public Element getRootElement()
        returns the root element of this document.
      • write

        public void write​(XmlSerializer writer)
                   throws IOException
        Writes this node to the given XmlWriter. For node and document, this method is identical to writeChildren, except that the stream is flushed automatically.
        Overrides:
        write in class Node
        Throws:
        IOException