Package com.xmlmind.domutil

## Class LoaderImpl

- java.lang.Object
- - com.xmlmind.domutil.LoaderImpl

- All Implemented Interfaces:
    `Loader`
  Direct Known Subclasses:
    `XLoader`

      public class LoaderImpl
      extends Object
      implements Loader

  An implementation of `Loader` making use by default of the built-in XInclude processor (possibly XInclude 1.0, not 1.1; possibly limited) of the XML parser.

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `LoaderImpl()` |
    `LoaderImpl​(boolean xincludeAware, Console c)` |

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `static XMLReader` | `createXMLReader​(boolean xincludeAware)` |
    `static String` | `format​(SAXParseException e)` |
    `ConsoleHelper` | `getConsole()` | Returns the console on which messages issued during document loading are to be displayed.
    `EntityResolver` | `getEntityResolver()` | Returns the entity resolver being used when loading an XML document.
    `static boolean` | `isAddingElementPointer()` | Not part of the public, documented, API: returns `true` if element XPath pointers are added to `NodeLocation`s during the loading of XML documents.
    `Document` | `load​(File file)` |
    `Document` | `load​(InputStream in, URL url)` | Load document from specified input stream.
    `Document` | `load​(URL url)` |
    `static void` | `setAddingElementPointer​(boolean add)` | Not part of the public, documented, API: specifies whether to add element XPath pointers to `NodeLocation`s during the loading of XML documents.
    `void` | `setConsole​(Console c)` | Specifies the console on which messages issued during document loading are to be displayed.
    `void` | `setEntityResolver​(EntityResolver resolver)` | Specifies which entity resolver to use when loading an XML document.

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

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

- - ### Constructor Detail

    - #### LoaderImpl

          public LoaderImpl()

    - #### LoaderImpl

          public LoaderImpl​(boolean xincludeAware,
                            Console c)

  - ### Method Detail

    - #### setAddingElementPointer

          public static void setAddingElementPointer​(boolean add)

      Not part of the public, documented, API: specifies whether to add element XPath pointers to `NodeLocation`s during the loading of XML documents.

      This facility is needed to implement XXE's Check Assembly.

      See Also:
        `isAddingElementPointer()`

    - #### isAddingElementPointer

          public static boolean isAddingElementPointer()

      Not part of the public, documented, API: returns `true` if element XPath pointers are added to `NodeLocation`s during the loading of XML documents.

      This facility is needed to implement XXE's Check Assembly.

      See Also:
        `setAddingElementPointer(boolean)`

    - #### setConsole

          public void setConsole​(Console c)

      Description copied from interface: `Loader`
      Specifies the console on which messages issued during document loading are to be displayed.
      Specified by:
        `setConsole` in interface `Loader`
      Parameters:
        `c` - the console; may be `null`, in which case messages are displayed on `System.err` and `System.out`
      See Also:
        `Loader.getConsole()`

    - #### getConsole

          public ConsoleHelper getConsole()

      Description copied from interface: `Loader`
      Returns the console on which messages issued during document loading are to be displayed.
      Specified by:
        `getConsole` in interface `Loader`
      See Also:
        `Loader.setConsole(com.xmlmind.util.Console)`

    - #### setEntityResolver

          public void setEntityResolver​(EntityResolver resolver)

      Description copied from interface: `Loader`
      Specifies which entity resolver to use when loading an XML document.
      Specified by:
        `setEntityResolver` in interface `Loader`
      Parameters:
        `resolver` - which resolver to use. May be `null`.
      See Also:
        `Loader.getEntityResolver()`

    - #### getEntityResolver

          public EntityResolver getEntityResolver()

      Description copied from interface: `Loader`
      Returns the entity resolver being used when loading an XML document. May return `null`.
      Specified by:
        `getEntityResolver` in interface `Loader`
      See Also:
        `Loader.setEntityResolver(org.xml.sax.EntityResolver)`

    - #### load

          public Document load​(File file)
                        throws IOException

      Throws:
        `IOException`

    - #### load

          public Document load​(URL url)
                        throws IOException

      Throws:
        `IOException`

    - #### load

          public Document load​(InputStream in,
                               URL url)
                        throws IOException

      Description copied from interface: `Loader`
      Load document from specified input stream.

      Note: `xi:include` elements (XInclude) are expected to have been processed in the loaded document.

      Specified by:
        `load` in interface `Loader`
      Parameters:
        `in` - input stream allowing to load the document
        `url` - URL of the document to be loaded if known; `null` otherwise
      Returns:
        loaded document
      Throws:
        `IOException` - if, for any reason, an I/O exception is raised during the processing. Note that XML parse exception and XInclude exception are reported as `IOException`s.

    - #### createXMLReader

          public static XMLReader createXMLReader​(boolean xincludeAware)

    - #### format

          public static final String format​(SAXParseException e)