Package com.xmlmind.domutil
Class LoaderImpl
- java.lang.Object
-
- com.xmlmind.domutil.LoaderImpl
-
-
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: returnstrue
if element XPath pointers are added toNodeLocation
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 toNodeLocation
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.
-
-
-
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 toNodeLocation
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: returnstrue
if element XPath pointers are added toNodeLocation
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 interfaceLoader
- Parameters:
c
- the console; may benull
, in which case messages are displayed onSystem.err
andSystem.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 interfaceLoader
- 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 interfaceLoader
- Parameters:
resolver
- which resolver to use. May benull
.- 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 returnnull
.- Specified by:
getEntityResolver
in interfaceLoader
- 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 interfaceLoader
- Parameters:
in
- input stream allowing to load the documenturl
- 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 asIOException
s.
-
createXMLReader
public static XMLReader createXMLReader(boolean xincludeAware)
-
format
public static final String format(SAXParseException e)
-
-