|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.xml.sax.helpers.DefaultHandler | +--org.custommonkey.xmlunit.Validator
Validates XML against its internal or external DOCTYPE, or a completely different DOCTYPE. Usage:
new Validator(readerForXML);
new Validator(readerForXML, systemIdForValidation);
new Validator(readerForXML, systemIdForValidation, doctypeName);
Constructor Summary | |
|
Validator(org.w3c.dom.Document document,
java.lang.String systemID,
java.lang.String doctype)
DOM-style constructor: allows Document validation post-manipulation of the DOM tree's contents. |
protected |
Validator(org.xml.sax.InputSource inputSource,
boolean usingDoctypeReader)
Baseline constructor: called by all others |
|
Validator(java.io.Reader readerForValidation)
Basic constructor. |
|
Validator(java.io.Reader readerForValidation,
java.lang.String systemID)
Extended constructor. |
|
Validator(java.io.Reader readerForValidation,
java.lang.String systemID,
java.lang.String doctype)
Full constructor. |
Method Summary | |
void |
assertIsValid()
Assert that a document is valid. |
void |
error(org.xml.sax.SAXParseException exception)
ErrorHandler interface method |
void |
fatalError(org.xml.sax.SAXParseException exception)
ErrorHandler interface method |
boolean |
isValid()
Perform the validation of the source against DTD |
org.xml.sax.InputSource |
resolveEntity(java.lang.String publicId,
java.lang.String systemId)
Entity Resolver method: allows us to override an existing systemID referenced in the markup DOCTYPE instruction |
java.lang.String |
toString()
|
void |
useXMLSchema(boolean use)
Turn on XML Schema validation. |
void |
warning(org.xml.sax.SAXParseException exception)
ErrorHandler interface method |
Methods inherited from class org.xml.sax.helpers.DefaultHandler |
characters, endDocument, endElement, endPrefixMapping, ignorableWhitespace, notationDecl, processingInstruction, setDocumentLocator, skippedEntity, startDocument, startElement, startPrefixMapping, unparsedEntityDecl |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
protected Validator(org.xml.sax.InputSource inputSource, boolean usingDoctypeReader) throws javax.xml.parsers.ParserConfigurationException, org.xml.sax.SAXException
inputSource
- usingDoctypeReader
-
javax.xml.parsers.ParserConfigurationException
org.xml.sax.SAXException
public Validator(org.w3c.dom.Document document, java.lang.String systemID, java.lang.String doctype) throws javax.xml.parsers.ParserConfigurationException, org.xml.sax.SAXException
document
- systemID
- doctype
-
javax.xml.parsers.ParserConfigurationException
- if unable to turn validation feature
on in JAXP factory
org.xml.sax.SAXException
- if unable to obtain new Sax parser via JAXP factorypublic Validator(java.io.Reader readerForValidation) throws javax.xml.parsers.ParserConfigurationException, org.xml.sax.SAXException
readerForValidation
-
javax.xml.parsers.ParserConfigurationException
- if unable to turn validation feature
on in JAXP factory
org.xml.sax.SAXException
- if unable to obtain new Sax parser via JAXP factorypublic Validator(java.io.Reader readerForValidation, java.lang.String systemID) throws javax.xml.parsers.ParserConfigurationException, org.xml.sax.SAXException
readerForValidation
- systemID
-
javax.xml.parsers.ParserConfigurationException
- if unable to turn validation feature
on in JAXP factory
org.xml.sax.SAXException
- if unable to obtain new Sax parser via JAXP factorypublic Validator(java.io.Reader readerForValidation, java.lang.String systemID, java.lang.String doctype) throws javax.xml.parsers.ParserConfigurationException, org.xml.sax.SAXException
readerForValidation
- systemID
- doctype
-
javax.xml.parsers.ParserConfigurationException
org.xml.sax.SAXException
Method Detail |
public void useXMLSchema(boolean use) throws org.xml.sax.SAXException
use
- indicate that XML Schema should be used to validate documents.
org.xml.sax.SAXException
public boolean isValid()
public void assertIsValid()
public java.lang.String toString()
toString
in class java.lang.Object
public void warning(org.xml.sax.SAXParseException exception) throws org.xml.sax.SAXException
warning
in interface org.xml.sax.ErrorHandler
warning
in class org.xml.sax.helpers.DefaultHandler
exception
-
org.xml.sax.SAXException
public void error(org.xml.sax.SAXParseException exception) throws org.xml.sax.SAXException
error
in interface org.xml.sax.ErrorHandler
error
in class org.xml.sax.helpers.DefaultHandler
exception
-
org.xml.sax.SAXException
public void fatalError(org.xml.sax.SAXParseException exception) throws org.xml.sax.SAXException
fatalError
in interface org.xml.sax.ErrorHandler
fatalError
in class org.xml.sax.helpers.DefaultHandler
exception
-
org.xml.sax.SAXException
public org.xml.sax.InputSource resolveEntity(java.lang.String publicId, java.lang.String systemId)
resolveEntity
in interface org.xml.sax.EntityResolver
resolveEntity
in class org.xml.sax.helpers.DefaultHandler
publicId
- systemId
-
|
XMLUnit is hosted by sourceforge.net |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |