Class DefaultErrorHandler
java.lang.Object
org.htmlunit.xpath.xml.utils.DefaultErrorHandler
- All Implemented Interfaces:
ErrorListener
Implement SAX error handler for default reporting.
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) PrintWriter(package private) final booleanif this flag is set to true, we will rethrow the exception on the error() and fatalError() methods. -
Constructor Summary
ConstructorsConstructorDescriptionConstructor DefaultErrorHandlerDefaultErrorHandler(boolean throwExceptionOnError) Constructor DefaultErrorHandler -
Method Summary
Modifier and TypeMethodDescriptionvoiderror(TransformerException exception) voidfatalError(TransformerException exception) Retrievejava.io.PrintWriterto which errors are being directed.voidwarning(TransformerException exception)
-
Field Details
-
m_pw
PrintWriter m_pw -
m_throwExceptionOnError
final boolean m_throwExceptionOnErrorif this flag is set to true, we will rethrow the exception on the error() and fatalError() methods. If it is false, the errors are reported to System.err.
-
-
Constructor Details
-
DefaultErrorHandler
public DefaultErrorHandler()Constructor DefaultErrorHandler -
DefaultErrorHandler
public DefaultErrorHandler(boolean throwExceptionOnError) Constructor DefaultErrorHandler- Parameters:
throwExceptionOnError- boolean for throwExceptionOnError
-
-
Method Details
-
getErrorWriter
Retrievejava.io.PrintWriterto which errors are being directed.- Returns:
- The
PrintWriterinstalled via the constructor or the defaultPrintWriter
-
warning
- Specified by:
warningin interfaceErrorListener- Throws:
TransformerException
-
error
- Specified by:
errorin interfaceErrorListener- Throws:
TransformerException
-
fatalError
- Specified by:
fatalErrorin interfaceErrorListener- Throws:
TransformerException
-