Class SAXValidator
java.lang.Object
org.dom4j.io.SAXValidator
SAXValidator
validates an XML document by writing the document
to a text buffer and parsing it with a validating SAX parser. This could be
implemented much more efficiently by validating against the dom4j object
model directly but at least allows the reuse of existing SAX based validating
parsers.
- Version:
- $Revision: 1.10 $
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate ErrorHandler
ErrorHandler class to useprivate XMLReader
XMLReader
used to parse the SAX events -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
Configures the XMLReader before useprotected XMLReader
Factory Method to allow alternate methods of creating and configuring XMLReader objectsDOCUMENT ME!DOCUMENT ME!void
setErrorHandler
(ErrorHandler errorHandler) Sets theErrorHandler
used by the SAXXMLReader
.void
setXMLReader
(XMLReader reader) Sets theXMLReader
used to parse SAX eventsvoid
Validates the givenDocument
by writing it to a validating SAX Parser.
-
Field Details
-
xmlReader
XMLReader
used to parse the SAX events -
errorHandler
ErrorHandler class to use
-
-
Constructor Details
-
SAXValidator
public SAXValidator() -
SAXValidator
-
-
Method Details
-
validate
Validates the givenDocument
by writing it to a validating SAX Parser.- Parameters:
document
- is the Document to validate- Throws:
SAXException
- if a validation error occursRuntimeException
- DOCUMENT ME!
-
getXMLReader
DOCUMENT ME!- Returns:
- the
XMLReader
used to parse SAX events - Throws:
SAXException
- DOCUMENT ME!
-
setXMLReader
Sets theXMLReader
used to parse SAX events- Parameters:
reader
- is theXMLReader
to parse SAX events- Throws:
SAXException
- DOCUMENT ME!
-
getErrorHandler
-
setErrorHandler
Sets theErrorHandler
used by the SAXXMLReader
.- Parameters:
errorHandler
- is theErrorHandler
used by SAX
-
createXMLReader
Factory Method to allow alternate methods of creating and configuring XMLReader objects- Returns:
- DOCUMENT ME!
- Throws:
SAXException
- DOCUMENT ME!
-
configureReader
Configures the XMLReader before use- Throws:
SAXException
- DOCUMENT ME!
-