|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.springframework.beans.factory.xml.DefaultDocumentLoader
public class DefaultDocumentLoader
Spring's default DocumentLoader
implementation.
Simply loads documents
using the standard JAXP-configured
XML parser. If you want to change the DocumentBuilder
that is used to
load documents, then one strategy is to define a corresponding Java system property
when starting your JVM. For example, to use the Oracle DocumentBuilder
,
you might start your application like as follows:
java -Djavax.xml.parsers.DocumentBuilderFactory=oracle.xml.jaxp.JXDocumentBuilderFactory MyMainClass
Constructor Summary | |
---|---|
DefaultDocumentLoader()
|
Method Summary | |
---|---|
protected DocumentBuilder |
createDocumentBuilder(DocumentBuilderFactory factory,
EntityResolver entityResolver,
ErrorHandler errorHandler)
Create a JAXP DocumentBuilder that this bean definition reader will use for parsing XML documents. |
protected DocumentBuilderFactory |
createDocumentBuilderFactory(int validationMode,
boolean namespaceAware)
Create the DocumentBuilderFactory instance. |
Document |
loadDocument(InputSource inputSource,
EntityResolver entityResolver,
ErrorHandler errorHandler,
int validationMode,
boolean namespaceAware)
Load the Document at the supplied InputSource using the standard JAXP-configured
XML parser. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DefaultDocumentLoader()
Method Detail |
---|
public Document loadDocument(InputSource inputSource, EntityResolver entityResolver, ErrorHandler errorHandler, int validationMode, boolean namespaceAware) throws Exception
Document
at the supplied InputSource
using the standard JAXP-configured
XML parser.
loadDocument
in interface DocumentLoader
inputSource
- the source of the document that is to be loadedentityResolver
- the resolver that is to be used to resolve any entitieserrorHandler
- used to report any errors during document loadingvalidationMode
- the type of validation
DTD
or XSD
)namespaceAware
- true
if the loading is provide support for XML namespaces
document
Exception
- if an error occursprotected DocumentBuilderFactory createDocumentBuilderFactory(int validationMode, boolean namespaceAware) throws ParserConfigurationException
DocumentBuilderFactory
instance.
validationMode
- the type of validation: DTD
or XSD
)namespaceAware
- whether the returned factory is to provide support for XML namespaces
ParserConfigurationException
- if we failed to build a proper DocumentBuilderFactoryprotected DocumentBuilder createDocumentBuilder(DocumentBuilderFactory factory, EntityResolver entityResolver, ErrorHandler errorHandler) throws ParserConfigurationException
factory
- the JAXP DocumentBuilderFactory that the DocumentBuilder
should be created withentityResolver
- the SAX EntityResolver to useerrorHandler
- the SAX ErrorHandler to use
ParserConfigurationException
- if thrown by JAXP methods
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |