|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
A SAX 2 content handler that validates the content it receives. A ValidatorHandler
is not safe for concurrent access for multiple threads. A single ValidatorHandler
can be used to validate only a single document at a time. It can be used to validate a sequence of
documents by calling reset
between documents. If multiple documents must be validated
concurrently, then a separate ValidatorHandler
must be used for each document.
ValidatorHandler
extends DTDHandler
so that validation can have access
to information about the DTD, specifically the unparsed entities and notations.
Method Summary | |
ErrorHandler |
getErrorHandler()
Returns the current ErrorHandler as set by setErrorHandler . |
boolean |
isComplete()
Reports whether the complete document has been received, that is, whether endDocument has been called. |
boolean |
isValidSoFar()
Reports whether the content received so far is valid. |
void |
reset()
Prepares to receive the content of another document. |
void |
setErrorHandler(ErrorHandler eh)
Sets the current ErrorHandler to be used for reporting validation errors. |
Methods inherited from interface org.xml.sax.ContentHandler |
characters, endDocument, endElement, endPrefixMapping, ignorableWhitespace, processingInstruction, setDocumentLocator, skippedEntity, startDocument, startElement, startPrefixMapping |
Methods inherited from interface org.xml.sax.DTDHandler |
notationDecl, unparsedEntityDecl |
Method Detail |
public boolean isValidSoFar()
endDocument
, then it reports whether the content received so far
is such that subsequent content may result in a valid document. If this is
called after endDocument
, then it reports whether the content
received constitutes a valid document.
true
if the content is valid; false
otherwise.public boolean isComplete()
endDocument
has been called.
true
if the complete document has been received; false
otherwise.public void reset()
reset
is called
isValidSoFar
will return true
and isComplete
will return false.
The current ErrorHandler
is not affected.
public void setErrorHandler(ErrorHandler eh)
ErrorHandler
to be used for reporting validation errors. This
may be called at any time, even after this ValidatorHandler
has started to
received content.
eh
- the error handler to use for reporting errors; null
if errors should
not be reportedgetErrorHandler()
public ErrorHandler getErrorHandler()
ErrorHandler
as set by setErrorHandler
.
ErrorHandler
; maybe null
if no ErrorHandler
has been set.setErrorHandler(org.xml.sax.ErrorHandler)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |