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 $
- Author:
- James Strachan
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidConfigures the XMLReader before useprotected XMLReaderFactory Method to allow alternate methods of creating and configuring XMLReader objectsDOCUMENT ME!DOCUMENT ME!voidsetErrorHandler(ErrorHandler errorHandler) Sets theErrorHandlerused by the SAXXMLReader.voidsetXMLReader(XMLReader reader) Sets theXMLReaderused to parse SAX eventsvoidValidates the givenDocumentby writing it to a validating SAX Parser.
-
Constructor Details
-
SAXValidator
public SAXValidator() -
SAXValidator
-
-
Method Details
-
validate
Validates the givenDocumentby 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
XMLReaderused to parse SAX events - Throws:
SAXException- DOCUMENT ME!
-
setXMLReader
Sets theXMLReaderused to parse SAX events- Parameters:
reader- is theXMLReaderto parse SAX events- Throws:
SAXException- DOCUMENT ME!
-
getErrorHandler
-
setErrorHandler
Sets theErrorHandlerused by the SAXXMLReader.- Parameters:
errorHandler- is theErrorHandlerused 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!
-