Package org.dlese.dpc.xml
Class SimpleErrorHandler
java.lang.Object
org.xml.sax.helpers.DefaultHandler
org.dlese.dpc.xml.SimpleErrorHandler
- All Implemented Interfaces:
ContentHandler,DTDHandler,EntityResolver,ErrorHandler,LexicalHandler
A simple XML error handler that catches XML errors and warnings and saves them to
StringBuffers so the errors can be extracted and displayed.
- Author:
- John Weatherley
-
Method Summary
Modifier and TypeMethodDescriptionvoidcomment(char[] ch, int start, int length) DESCRIPTIONvoidendCDATA()DESCRIPTIONvoidendDTD()DESCRIPTIONvoidDESCRIPTIONvoiderror(SAXParseException exc) DESCRIPTIONvoidDESCRIPTIONbooleanDetermines whether the parser found any validation errors.booleanDetermines whether the parser found any validation warnings.voidDESCRIPTIONvoidDESCRIPTIONvoidstartEntity(String name) DESCRIPTIONvoidwarning(SAXParseException exc) DESCRIPTIONMethods inherited from class org.xml.sax.helpers.DefaultHandler
characters, endDocument, endElement, endPrefixMapping, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startDocument, startElement, startPrefixMapping, unparsedEntityDeclMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.xml.sax.ContentHandler
declaration
-
Method Details
-
error
DESCRIPTION- Specified by:
errorin interfaceErrorHandler- Overrides:
errorin classDefaultHandler- Parameters:
exc- DESCRIPTION
-
hasErrors
public boolean hasErrors()Determines whether the parser found any validation errors.- Returns:
- True if errors were found, else false.
-
hasWarnings
public boolean hasWarnings()Determines whether the parser found any validation warnings.- Returns:
- True if warnings were found, else false.
-
fatalError
DESCRIPTION- Specified by:
fatalErrorin interfaceErrorHandler- Overrides:
fatalErrorin classDefaultHandler- Parameters:
exc- DESCRIPTION
-
warning
DESCRIPTION- Specified by:
warningin interfaceErrorHandler- Overrides:
warningin classDefaultHandler- Parameters:
exc- DESCRIPTION
-
startDTD
DESCRIPTION- Specified by:
startDTDin interfaceLexicalHandler- Parameters:
name- DESCRIPTIONpublicId- DESCRIPTIONsystemId- DESCRIPTION- Throws:
SAXException- DESCRIPTION
-
endDTD
DESCRIPTION- Specified by:
endDTDin interfaceLexicalHandler- Throws:
SAXException- DESCRIPTION
-
startEntity
DESCRIPTION- Specified by:
startEntityin interfaceLexicalHandler- Parameters:
name- DESCRIPTION- Throws:
SAXException- DESCRIPTION
-
endEntity
DESCRIPTION- Specified by:
endEntityin interfaceLexicalHandler- Parameters:
name- DESCRIPTION- Throws:
SAXException- DESCRIPTION
-
startCDATA
DESCRIPTION- Specified by:
startCDATAin interfaceLexicalHandler- Throws:
SAXException- DESCRIPTION
-
endCDATA
DESCRIPTION- Specified by:
endCDATAin interfaceLexicalHandler- Throws:
SAXException- DESCRIPTION
-
comment
DESCRIPTION- Specified by:
commentin interfaceLexicalHandler- Parameters:
ch- DESCRIPTIONstart- DESCRIPTIONlength- DESCRIPTION- Throws:
SAXException- DESCRIPTION
-