Class 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 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 NodeLocations 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 NodeLocations 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()
      • 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 IOExceptions.
      • createXMLReader

        public static XMLReader createXMLReader​(boolean xincludeAware)