|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.xml.sax.helpers.DefaultHandler
com.cgiams.esl.common.xml.XMLErrorHandler
This is an Error Handler class for capturing any parse errors that might
occur during XML schema validation. This class implements the ErrorHandler
interface and can be used by either the DOM or SAX parse objects.
Any Warnings or Errors that occur during parsing are collected
until the entire XML document is parsed. All warning and/or error messages
can be retrieved using the getWarningMessages() and
getErrorMessages() methods, respectively. Only the last
SAXParseException that may have occurred is available by calling the
getLastException() method.
If a single Fatal Error is encountered during parsing, the
SAXParseException that was responsible is immediately rethrown to the caller.
The actual exception can be retrieved from a call to getLastException()
while the message text is available from the getErrorMessages() method.
Modification History | ||
---|---|---|
Programmer | Date | Description |
Scott Bowers | April 2005 | Initial version. |
Constructor Summary | |
XMLErrorHandler()
|
Method Summary | |
void |
error(org.xml.sax.SAXParseException ao_exception)
API called by the DocumentBuilder if an error occurs during parsing of the XML document. |
void |
fatalError(org.xml.sax.SAXParseException ao_exception)
API called by the DocumentBuilder if a fatal error occurs during parsing of the XML document. |
java.lang.String |
getAllMessages()
Return a String of all Error and Warning messages. |
java.lang.String |
getErrorMessages()
Returns a formatted string of all Error Messages. |
org.xml.sax.SAXParseException |
getLastException()
Retrieve the last parsing exception that occured during validation. |
java.lang.String |
getWarningMessages()
Returns a formatted string of all Warning Messages. |
boolean |
handleEvent(javax.xml.bind.ValidationEvent event)
Receive notification of a validation warning or error. |
boolean |
hasErrors()
Determines whethere any error occured during parsing. |
boolean |
hasWarnings()
Determines whethere any error occured during parsing. |
boolean |
isClean()
Determines whether there are no errors or warnings of any kind. |
void |
warning(org.xml.sax.SAXParseException ao_exception)
API called by the DocumentBuilder if a warning occurs during parsing of the XML document. |
Methods inherited from class org.xml.sax.helpers.DefaultHandler |
characters, endDocument, endElement, endPrefixMapping, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startDocument, startElement, startPrefixMapping, unparsedEntityDecl |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public XMLErrorHandler()
Method Detail |
public boolean handleEvent(javax.xml.bind.ValidationEvent event)
handleEvent
in interface javax.xml.bind.ValidationEventHandler
event
- The encapsulated validation event information. It is a
provider error if this parameter is null.
public boolean hasErrors()
public boolean hasWarnings()
public boolean isClean()
public java.lang.String getErrorMessages()
public java.lang.String getWarningMessages()
public java.lang.String getAllMessages()
public org.xml.sax.SAXParseException getLastException()
public void error(org.xml.sax.SAXParseException ao_exception) throws org.xml.sax.SAXException
error
in interface org.xml.sax.ErrorHandler
ao_exception
- The SAXParseException that occured.
java.lang.IllegalArgumentException
- If incoming exception is null.
org.xml.sax.SAXException
- If any exception occurs.public void fatalError(org.xml.sax.SAXParseException ao_exception) throws org.xml.sax.SAXException
fatalError
in interface org.xml.sax.ErrorHandler
ao_exception
- The SAXParseException that occured.
java.lang.IllegalArgumentException
- If incoming exception is null.
org.xml.sax.SAXException
- If any exception occurs.public void warning(org.xml.sax.SAXParseException ao_exception) throws org.xml.sax.SAXException
warning
in interface org.xml.sax.ErrorHandler
ao_exception
- The SAXParseException that occured.
java.lang.IllegalArgumentException
- If incoming exception is null.
org.xml.sax.SAXException
- If any exception occurs.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |