public interface Validator
Validatoris created and cannot be changed. The XML document is provided to the
Validatorby calling methods of the
ContentHandlerobject returned by
getContentHandler; the methods must be called in the sequence specified by the
ContentHandlerinterface. If the
getDTDHandlermethod returns a non-null object, then method calls must be made on it reporting DTD information.
Any errors will be reported to the
specified when the
Validator was created. If, after the
call to the
endDocument method, no errors have been
reported, then the XML document is valid.
Validator object is not safe for
concurrent access from multiple threads. A single
ValidatorHandler can be used to validate only a single
document at a time.
After completing validation of an XML document (i.e. after calling
endDocument on the
reset can be called to allow validation of another
reset method may create new
DTDHandler objects or may simply reinitialize the
state of the existing objects. Therefore,
getDTDHandler must be called after
to retrieve the objects to which the XML document to be validated
must be provided.
|Modifier and Type||Method and Description|
Returns the ContentHandler that will receive the XML document.
Returns a DTDHandler.
Cleans up after validating a document.
nullis returned. The same object will always be returned unless
resetis called: this method does not change the state of the Validator.
nullif DTD information is not significant to the
resetmust be called. After calling reset(), another document may be validated. Calling this method may create new ContentHandler and DTDHandler objects or may simply reinitialize the state of the existing objects.