public abstract class AbstractConfiguredDOMBuilder extends java.lang.Object implements ConfiguredDOMBuilder
Modifier and Type | Class and Description |
---|---|
protected static class |
AbstractConfiguredDOMBuilder.SaxErrorCollector
Simple implementation of SAX error handler when validating against schema.
|
Modifier and Type | Field and Description |
---|---|
private javax.xml.parsers.DocumentBuilderFactory |
_builderFactory |
private AbstractConfiguredDOMBuilder.SaxErrorCollector |
_errorHandler |
private static org.apache.log4j.Logger |
_logger |
Modifier | Constructor and Description |
---|---|
protected |
AbstractConfiguredDOMBuilder(boolean builderFactorySetValidate) |
Modifier and Type | Method and Description |
---|---|
protected javax.xml.parsers.DocumentBuilder |
getDOMBuilder() |
protected javax.xml.parsers.DocumentBuilderFactory |
getDOMBuilderFactory() |
protected org.xml.sax.ErrorHandler |
getErrorHandler() |
SaxErrorData |
getParsingErrors()
Returns errors collected during parsing; may be empty but never null.
|
protected javax.xml.validation.SchemaFactory |
getSchemaFactory()
This default implementation returns null; override to return configured schema factory.
|
org.w3c.dom.Document |
readAndValidate(java.io.File xmlFile)
Reads and validates
xmlFile and returns it as DOM document. |
private org.w3c.dom.Document |
readAndValidate(java.io.File xmlFile,
org.xml.sax.InputSource src,
java.lang.String message) |
org.w3c.dom.Document |
readAndValidate(org.xml.sax.InputSource source)
Reads and validates
source and returns it as DOM document. |
org.w3c.dom.Document |
readAndValidate(XmlString xmlText)
Reads and validates
xmlText and returns it as DOM document. |
private static final org.apache.log4j.Logger _logger
private final javax.xml.parsers.DocumentBuilderFactory _builderFactory
private final AbstractConfiguredDOMBuilder.SaxErrorCollector _errorHandler
protected AbstractConfiguredDOMBuilder(boolean builderFactorySetValidate)
protected final javax.xml.parsers.DocumentBuilderFactory getDOMBuilderFactory()
protected final javax.xml.parsers.DocumentBuilder getDOMBuilder() throws javax.xml.parsers.ParserConfigurationException
javax.xml.parsers.ParserConfigurationException
public final SaxErrorData getParsingErrors()
ConfiguredDOMBuilder
getParsingErrors
in interface ConfiguredDOMBuilder
public final org.w3c.dom.Document readAndValidate(java.io.File xmlFile)
ConfiguredDOMBuilder
xmlFile
and returns it as DOM document.readAndValidate
in interface ConfiguredDOMBuilder
public final org.w3c.dom.Document readAndValidate(XmlString xmlText)
ConfiguredDOMBuilder
xmlText
and returns it as DOM document.readAndValidate
in interface ConfiguredDOMBuilder
public final org.w3c.dom.Document readAndValidate(org.xml.sax.InputSource source)
ConfiguredDOMBuilder
source
and returns it as DOM document.readAndValidate
in interface ConfiguredDOMBuilder
private org.w3c.dom.Document readAndValidate(java.io.File xmlFile, org.xml.sax.InputSource src, java.lang.String message)
protected final org.xml.sax.ErrorHandler getErrorHandler()
protected javax.xml.validation.SchemaFactory getSchemaFactory()
Copyright 2009-2015 Tatjana (Tanja) Kostic