Class XmlErrorHandler
- java.lang.Object
-
- org.apache.tomcat.util.descriptor.XmlErrorHandler
-
- All Implemented Interfaces:
org.xml.sax.ErrorHandler
public class XmlErrorHandler extends java.lang.Object implements org.xml.sax.ErrorHandlerSAX error handler that collects warnings and errors for later processing.
-
-
Constructor Summary
Constructors Constructor Description XmlErrorHandler()Default constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiderror(org.xml.sax.SAXParseException exception)voidfatalError(org.xml.sax.SAXParseException exception)java.util.List<org.xml.sax.SAXParseException>getErrors()Returns the list of collected parsing errors.java.util.List<org.xml.sax.SAXParseException>getWarnings()Returns the list of collected parsing warnings.voidlogFindings(Log log, java.lang.String source)Logs all collected warnings and errors to the specified log.voidwarning(org.xml.sax.SAXParseException exception)
-
-
-
Method Detail
-
error
public void error(org.xml.sax.SAXParseException exception) throws org.xml.sax.SAXException- Specified by:
errorin interfaceorg.xml.sax.ErrorHandler- Throws:
org.xml.sax.SAXException
-
fatalError
public void fatalError(org.xml.sax.SAXParseException exception) throws org.xml.sax.SAXException- Specified by:
fatalErrorin interfaceorg.xml.sax.ErrorHandler- Throws:
org.xml.sax.SAXException
-
warning
public void warning(org.xml.sax.SAXParseException exception) throws org.xml.sax.SAXException- Specified by:
warningin interfaceorg.xml.sax.ErrorHandler- Throws:
org.xml.sax.SAXException
-
getErrors
public java.util.List<org.xml.sax.SAXParseException> getErrors()
Returns the list of collected parsing errors.- Returns:
- the list of errors
-
getWarnings
public java.util.List<org.xml.sax.SAXParseException> getWarnings()
Returns the list of collected parsing warnings.- Returns:
- the list of warnings
-
logFindings
public void logFindings(Log log, java.lang.String source)
Logs all collected warnings and errors to the specified log.- Parameters:
log- the log to usesource- the source of the XML being parsed
-
-