org.apache.xmlbeans.impl.common

## Class DocumentHelper

- java.lang.Object
- - org.apache.xmlbeans.impl.common.DocumentHelper

-     public final class DocumentHelper
      extends Object

- - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static Document` | `createDocument()` Creates a new DOM Document
    `static DocumentBuilder` | `newDocumentBuilder(XmlOptionsBean xmlOptions)` Creates a new document builder, with sensible defaults
    `static Document` | `readDocument(XmlOptionsBean xmlOptions, InputSource inp)` Parses the given stream via the default (sensible) DocumentBuilder
    `static Document` | `readDocument(XmlOptionsBean xmlOptions, InputStream inp)` Parses the given stream via the default (sensible) DocumentBuilder

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### newDocumentBuilder

          public static DocumentBuilder newDocumentBuilder(XmlOptionsBean xmlOptions)

      Creates a new document builder, with sensible defaults
      Parameters:
        `xmlOptions` -
      Throws:
        `IllegalStateException` - If creating the DocumentBuilder fails, e.g. due to `ParserConfigurationException`.

    - #### readDocument

          public static Document readDocument(XmlOptionsBean xmlOptions,
                                              InputStream inp)
                                       throws IOException,
                                              SAXException

      Parses the given stream via the default (sensible) DocumentBuilder
      Parameters:
        `inp` - Stream to read the XML data from
      Returns:
        the parsed Document
      Throws:
        `IOException`
        `SAXException`

    - #### readDocument

          public static Document readDocument(XmlOptionsBean xmlOptions,
                                              InputSource inp)
                                       throws IOException,
                                              SAXException

      Parses the given stream via the default (sensible) DocumentBuilder
      Parameters:
        `inp` - sax source to read the XML data from
      Returns:
        the parsed Document
      Throws:
        `IOException`
        `SAXException`

    - #### createDocument

          public static Document createDocument()

      Creates a new DOM Document