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 XMLReadercreateXMLReader(boolean xincludeAware)static Stringformat(SAXParseException e)ConsoleHelpergetConsole()Returns the console on which messages issued during document loading are to be displayed.EntityResolvergetEntityResolver()Returns the entity resolver being used when loading an XML document.static booleanisAddingElementPointer()Not part of the public, documented, API: returnstrueif element XPath pointers are added toNodeLocations during the loading of XML documents.Documentload(File file)Documentload(InputStream in, URL url)Load document from specified input stream.Documentload(URL url)static voidsetAddingElementPointer(boolean add)Not part of the public, documented, API: specifies whether to add element XPath pointers toNodeLocations during the loading of XML documents.voidsetConsole(Console c)Specifies the console on which messages issued during document loading are to be displayed.voidsetEntityResolver(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 toNodeLocations 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: returnstrueif element XPath pointers are added toNodeLocations 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:LoaderSpecifies the console on which messages issued during document loading are to be displayed.- Specified by:
setConsolein interfaceLoader- Parameters:
c- the console; may benull, in which case messages are displayed onSystem.errandSystem.out- See Also:
Loader.getConsole()
-
getConsole
public ConsoleHelper getConsole()
Description copied from interface:LoaderReturns the console on which messages issued during document loading are to be displayed.- Specified by:
getConsolein interfaceLoader- See Also:
Loader.setConsole(com.xmlmind.util.Console)
-
setEntityResolver
public void setEntityResolver(EntityResolver resolver)
Description copied from interface:LoaderSpecifies which entity resolver to use when loading an XML document.- Specified by:
setEntityResolverin interfaceLoader- Parameters:
resolver- which resolver to use. May benull.- See Also:
Loader.getEntityResolver()
-
getEntityResolver
public EntityResolver getEntityResolver()
Description copied from interface:LoaderReturns the entity resolver being used when loading an XML document. May returnnull.- Specified by:
getEntityResolverin 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:LoaderLoad document from specified input stream.Note:
xi:includeelements (XInclude) are expected to have been processed in the loaded document.- Specified by:
loadin interfaceLoader- Parameters:
in- input stream allowing to load the documenturl- URL of the document to be loaded if known;nullotherwise- 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 asIOExceptions.
-
createXMLReader
public static XMLReader createXMLReader(boolean xincludeAware)
-
format
public static final String format(SAXParseException e)
-
-