Class DefaultDocument

    • Constructor Detail

      • DefaultDocument

        public DefaultDocument()
      • DefaultDocument

        public DefaultDocument​(String name)
      • DefaultDocument

        public DefaultDocument​(Element rootElement)
      • DefaultDocument

        public DefaultDocument​(DocumentType docType)
    • Method Detail

      • getName

        public String getName()
        Description copied from interface: Node

        getName returns the name of this node. This is the XML local name of the element, attribute, entity or processing instruction. For CDATA and Text nodes this method will return null.

        Specified by:
        getName in interface Node
        Overrides:
        getName in class AbstractNode
        Returns:
        the XML name of this node
      • setName

        public void setName​(String name)
        Description copied from interface: Node

        Sets the text data of this node or this method will throw an UnsupportedOperationException if it is read-only.

        Specified by:
        setName in interface Node
        Overrides:
        setName in class AbstractNode
        Parameters:
        name - is the new name of this node
      • getRootElement

        public Element getRootElement()
        Description copied from interface: Document
        Returns the root Elementfor this document.
        Returns:
        the root element for this document
      • getDocType

        public DocumentType getDocType()
        Description copied from interface: Document
        DOCUMENT ME!
        Returns:
        the DocumentType property
      • setDocType

        public void setDocType​(DocumentType docType)
        Description copied from interface: Document
        Sets the DocumentType property
        Parameters:
        docType - DOCUMENT ME!
      • addDocType

        public Document addDocType​(String docTypeName,
                                   String publicId,
                                   String systemId)
        Description copied from interface: Document
        Adds a DOCTYPE declaration to this document
        Parameters:
        docTypeName - is the name of the root element
        publicId - is the PUBLIC URI
        systemId - is the SYSTEM URI
        Returns:
        this Document instance.
      • getXMLEncoding

        public String getXMLEncoding()
        Description copied from interface: Document
        Return the encoding of this document, as part of the XML declaration This is null when unspecified or when it is not known (such as when the Document was created in memory) or when the implementation does not support this operation. The way this encoding is retrieved also depends on the way the XML source is parsed. For instance, if the SAXReader is used and if the underlying XMLReader implementation support the org.xml.sax.ext.Locator2 interface, the result returned by this method is specified by the getEncoding() method of that interface.
        Specified by:
        getXMLEncoding in interface Document
        Overrides:
        getXMLEncoding in class AbstractDocument
        Returns:
        The encoding of this document, as stated in the XML declaration, or null if unknown.
      • getEntityResolver

        public EntityResolver getEntityResolver()
        Description copied from interface: Document
        DOCUMENT ME!
        Returns:
        the EntityResolver used to find resolve URIs such as for DTDs, or XML Schema documents
      • setEntityResolver

        public void setEntityResolver​(EntityResolver entityResolver)
        Description copied from interface: Document
        Sets the EntityResolver used to find resolve URIs such as for DTDs, or XML Schema documents
        Parameters:
        entityResolver - DOCUMENT ME!
      • clone

        public Object clone()
        Description copied from interface: Node

        clone will return a deep clone or if this node is read-only then clone will return the same instance.

        Specified by:
        clone in interface Node
        Overrides:
        clone in class AbstractNode
        Returns:
        a deep clone of myself or myself if I am read only.
      • processingInstructions

        public List<ProcessingInstruction> processingInstructions()
        Description copied from interface: Branch
        Returns a list of all the processing instructions in this branch. The list is backed by this branch so that changes to the list will be reflected in the branch but the reverse is not the case.
        Returns:
        a backed list of the processing instructions
      • processingInstructions

        public List<ProcessingInstruction> processingInstructions​(String target)
        Description copied from interface: Branch
        Returns a list of the processing instructions for the given target. The list is backed by this branch so that changes to the list will be reflected in the branch but the reverse is not the case.
        Parameters:
        target - DOCUMENT ME!
        Returns:
        a backed list of the processing instructions
      • processingInstruction

        public ProcessingInstruction processingInstruction​(String target)
        Description copied from interface: Branch
        DOCUMENT ME!
        Parameters:
        target - DOCUMENT ME!
        Returns:
        the processing instruction for the given target
      • removeProcessingInstruction

        public boolean removeProcessingInstruction​(String target)
        Description copied from interface: Branch
        Removes the processing instruction for the given target if it exists
        Parameters:
        target - DOCUMENT ME!
        Returns:
        true if a processing instruction was removed else false
      • setContent

        public void setContent​(List<Node> content)
        Description copied from interface: Branch
        Sets the contents of this branch as a List of Node instances.
        Parameters:
        content - is the list of nodes to use as the content for this branch.
      • clearContent

        public void clearContent()
        Description copied from interface: Branch
        Clears the content for this branch, removing any Node instances this branch may contain.
      • setDocumentFactory

        public void setDocumentFactory​(DocumentFactory documentFactory)