|
|||||||||
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
Field Summary | |
---|---|
private static Log |
logger
|
private static java.lang.String |
SCHEMA_LANGUAGE_ATTRIBUTE
JAXP attribute used to configure the schema language for validation. |
private static java.lang.String |
XSD_SCHEMA_LANGUAGE
JAXP attribute value indicating the XSD schema language. |
Constructor Summary | |
---|---|
DefaultDocumentLoader()
|
Method Summary | |
---|---|
protected javax.xml.parsers.DocumentBuilder |
createDocumentBuilder(javax.xml.parsers.DocumentBuilderFactory factory,
org.xml.sax.EntityResolver entityResolver,
org.xml.sax.ErrorHandler errorHandler)
Create a JAXP DocumentBuilder that this bean definition reader will use for parsing XML documents. |
protected javax.xml.parsers.DocumentBuilderFactory |
createDocumentBuilderFactory(int validationMode,
boolean namespaceAware)
Create the DocumentBuilderFactory instance. |
org.w3c.dom.Document |
loadDocument(org.xml.sax.InputSource inputSource,
org.xml.sax.EntityResolver entityResolver,
org.xml.sax.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 |
Field Detail |
---|
private static final java.lang.String SCHEMA_LANGUAGE_ATTRIBUTE
private static final java.lang.String XSD_SCHEMA_LANGUAGE
private static final Log logger
Constructor Detail |
---|
public DefaultDocumentLoader()
Method Detail |
---|
public org.w3c.dom.Document loadDocument(org.xml.sax.InputSource inputSource, org.xml.sax.EntityResolver entityResolver, org.xml.sax.ErrorHandler errorHandler, int validationMode, boolean namespaceAware) throws java.lang.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 support for XML namespaces is to be provided
document
java.lang.Exception
- if an error occursprotected javax.xml.parsers.DocumentBuilderFactory createDocumentBuilderFactory(int validationMode, boolean namespaceAware) throws javax.xml.parsers.ParserConfigurationException
DocumentBuilderFactory
instance.
validationMode
- the type of validation: DTD
or XSD
)namespaceAware
- whether the returned factory is to provide support for XML namespaces
javax.xml.parsers.ParserConfigurationException
- if we failed to build a proper DocumentBuilderFactoryprotected javax.xml.parsers.DocumentBuilder createDocumentBuilder(javax.xml.parsers.DocumentBuilderFactory factory, org.xml.sax.EntityResolver entityResolver, org.xml.sax.ErrorHandler errorHandler) throws javax.xml.parsers.ParserConfigurationException
factory
- the JAXP DocumentBuilderFactory that the DocumentBuilder
should be created withentityResolver
- the SAX EntityResolver to useerrorHandler
- the SAX ErrorHandler to use
javax.xml.parsers.ParserConfigurationException
- if thrown by JAXP methods
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |