Package org.htmlunit.xpath.xml.utils
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 boolean
if 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 TypeMethodDescriptionvoid
error
(TransformerException exception) void
fatalError
(TransformerException exception) Retrievejava.io.PrintWriter
to which errors are being directed.void
warning
(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.PrintWriter
to which errors are being directed.- Returns:
- The
PrintWriter
installed via the constructor or the defaultPrintWriter
-
warning
- Specified by:
warning
in interfaceErrorListener
- Throws:
TransformerException
-
error
- Specified by:
error
in interfaceErrorListener
- Throws:
TransformerException
-
fatalError
- Specified by:
fatalError
in interfaceErrorListener
- Throws:
TransformerException
-