org.custommonkey.xmlunit
public class Validator extends DefaultHandler implements ErrorHandler
new Validator(readerForXML); new Validator(readerForXML, systemIdForValidation); new Validator(readerForXML, systemIdForValidation, doctypeName); | Constructor Summary | |
|---|---|
| protected | Validator(InputSource inputSource, boolean usingDoctypeReader)
Baseline constructor: called by all others |
| Validator(Document document, String systemID, String doctype)
DOM-style constructor: allows Document validation post-manipulation
of the DOM tree's contents.
| |
| Validator(Reader readerForValidation)
Basic constructor.
| |
| Validator(Reader readerForValidation, String systemID)
Extended constructor.
| |
| Validator(Reader readerForValidation, String systemID, String doctype)
Full constructor.
| |
| Method Summary | |
|---|---|
| void | assertIsValid()
Assert that a document is valid. |
| void | error(SAXParseException exception)
ErrorHandler interface method |
| void | fatalError(SAXParseException exception)
ErrorHandler interface method |
| boolean | isValid()
Perform the validation of the source against DTD |
| InputSource | resolveEntity(String publicId, String systemId)
Entity Resolver method: allows us to override an existing systemID
referenced in the markup DOCTYPE instruction |
| String | toString() |
| void | useXMLSchema(boolean use)
Turn on XML Schema validation.
|
| void | warning(SAXParseException exception)
ErrorHandler interface method |
Parameters: inputSource usingDoctypeReader
Throws: ParserConfigurationException SAXException
Parameters: document systemID doctype
Throws: ParserConfigurationException if unable to turn validation feature on in JAXP factory SAXException if unable to obtain new Sax parser via JAXP factory
Parameters: readerForValidation
Throws: ParserConfigurationException if unable to turn validation feature on in JAXP factory SAXException if unable to obtain new Sax parser via JAXP factory
Parameters: readerForValidation systemID
Throws: ParserConfigurationException if unable to turn validation feature on in JAXP factory SAXException if unable to obtain new Sax parser via JAXP factory
Parameters: readerForValidation systemID doctype
Throws: ParserConfigurationException SAXException
Parameters: exception
Throws: SAXException
Parameters: exception
Throws: SAXException
Returns: true if the input supplied to the constructor passes validation, false otherwise
Parameters: publicId systemId
Returns: the sax InputSource that points to the overridden systemID
Returns: class name appended with validation messages
Parameters: use indicate that XML Schema should be used to validate documents.
Throws: SAXException
Parameters: exception
Throws: SAXException