|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.optimizationservices.oscommon.util.CommonErrorHandler
public class CommonErrorHandler
The CommonErrorHandler
class is derived from the SAX DefaultHandler
class and provides common ways to handle warning, error, and fatalerror.
DefaultHandler
Field Summary | |
---|---|
java.lang.String |
errorMessage
errorMessage holds the error message if any. |
java.lang.String |
warningMessage
warningMessage holds the warning message if any. |
Constructor Summary | |
---|---|
CommonErrorHandler()
|
Method Summary | |
---|---|
void |
error(org.xml.sax.SAXParseException e)
Handle notification of a recoverable error. |
void |
fatalError(org.xml.sax.SAXParseException e)
Handle notification of a non-recoverable error. |
boolean |
hasError()
|
boolean |
hasWarning()
|
static void |
main(java.lang.String[] argv)
main for test purposes. |
void |
warning(org.xml.sax.SAXParseException e)
Handle notification of a warning. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public java.lang.String errorMessage
public java.lang.String warningMessage
Constructor Detail |
---|
public CommonErrorHandler()
Method Detail |
---|
public void error(org.xml.sax.SAXParseException e) throws org.xml.sax.SAXException
This corresponds to the definition of "error" in section 1.2 of the W3C XML 1.0 Recommendation such as a validity constraint. The implemented behavior is to print the xml style error message and set the error flag true.
The SAX parser will continue to provide normal parsing events after invoking this method: it should still be possible for the application to process the document through to the end. If the application cannot do so, then the parser will report a fatal error.
error
in interface org.xml.sax.ErrorHandler
exception
- The error information encapsulated in a SAX parse exception.
org.xml.sax.SAXException
- Any SAX exception, possibly wrapping
another exception.SAXParseException
,
ErrorHandler.error(org.xml.sax.SAXParseException)
public void fatalError(org.xml.sax.SAXParseException e) throws org.xml.sax.SAXException
This corresponds to the definition of "fatal error" in section 1.2 of the W3C XML 1.0 Recommendation, such as a well-formedness constraint.The implemented behavior is to print the xml style error message and set the fatalError flag true.
The application will assume that the document is unusable after the parser has invoked this method, and will continue (if at all) only for the sake of collecting addition error messages: in fact, SAX parsers are free to stop reporting any other events once this method has been invoked.
fatalError
in interface org.xml.sax.ErrorHandler
exception
- The error information encapsulated in a SAX parse exception.
org.xml.sax.SAXException
- Any SAX exception, possibly wrapping
another exception.SAXParseException
,
ErrorHandler.fatalError(org.xml.sax.SAXParseException)
public void warning(org.xml.sax.SAXParseException e) throws org.xml.sax.SAXException
SAX parsers will use this method to report conditions that are not errors or fatal errors as defined by the XML 1.0 recommendation. The implemented behavior is to print the xml style warning message and set the warning flag true.
The SAX parser will continue to provide normal parsing events after invoking this method: it should still be possible for the application to process the document through to the end.
warning
in interface org.xml.sax.ErrorHandler
e
- The warning information encapsulated in a SAX parse exception.
org.xml.sax.SAXException
- Any SAX exception, possibly
wrapping another exception.SAXParseException
,
ErrorHandler.warning(org.xml.sax.SAXParseException)
public boolean hasError()
public boolean hasWarning()
public static void main(java.lang.String[] argv)
argv
- command line arguments.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |