@Deprecated
public interface ErrorListener
This interface is provided so that users can customize the error handling of the DeltaXML.com tools. For example users may wish to report errors in a GUI dialog box, or ignore non-fatal errors.
The interface should be implemented and then the implementation passed as an argument to the
XMLComparator.setErrorListener(ErrorListener)
method.
If a Comparator does not register an ErrorListener the default action is to report all warnings/errors/fatal-errors to System.err
All errors are reported in terms of the DeltaXMLProcessingException
class. In some cases the underlying cause may be a
different class of exception and it may be appropriate to use the getException()
method.
One such example are SAXParseExceptions which will be wrapped as DeltaXMLProcessingExceptions.
If a ErrorListener.fatalError(DeltaXMLProcessingException)
is encountered there is no guarantee of a correct, or indeed any, result
being produced.
A fatal error in addition to being reported through this listener (ErrorListener.fatalError(DeltaXMLProcessingException)
) will also
be thrown immediately afterwards. This give the user some control via the listener callback for example making it possible to
rethrow the error in various ways, but precludes the possibility of 'ignoring' fatal errors.
Modifier and Type | Method and Description |
---|---|
void |
error(DeltaXMLProcessingException e)
Deprecated.
Receive notification of a recoverable error.
|
void |
fatalError(DeltaXMLProcessingException e)
Deprecated.
Receive notification of a fatal error.
|
boolean |
getFatalDetected()
Deprecated.
Used to determine if any fatal errors have been reported through this listener since it was constructed.
|
void |
warning(DeltaXMLProcessingException e)
Deprecated.
Receive notification of a recoverable warning.
|
void error(DeltaXMLProcessingException e) throws DeltaXMLProcessingException
Receive notification of a recoverable error. A recoverable error is one where processing may continue and results such as a delta file or a recombined file may be partially produced.
e
- The error information encapsulated in a DeltaXMLProcessingException. The encapsulation may take the form of
the exception message or a wrapped exception.DeltaXMLProcessingException
- The Listener may choose to re-throw the original exception if it does not wish to deal
with it and thus terminate the comparison or combination.DeltaXMLProcessingException
void warning(DeltaXMLProcessingException e) throws DeltaXMLProcessingException
Receive notification of a recoverable warning.
A warning is neither an error or fatal error.
e
- The warning information encapsulated in a DeltaXMLProcessingException. The encapsulation may take the form
of the exception message or a wrapped exception.DeltaXMLProcessingException
- The Listener may choose to re-throw the original exception if it does not wish to deal
with it and thus terminate the comparison or combination.DeltaXMLProcessingException
void fatalError(DeltaXMLProcessingException e) throws DeltaXMLProcessingException
Receive notification of a fatal error.
A fatal error is one where processing may continue and further errors may be reported. However results such as a delta file or a recombined file may be incorrect or incomplete.
e
- The error information encapsulated in a DeltaXMLProcessingException. The encapsulation may take the form of
the exception message or a wrapped exception.DeltaXMLProcessingException
- The Listener may choose to re-throw the original exception if it does not wish to deal
with it and thus terminate the comparison or combination.DeltaXMLProcessingException
boolean getFatalDetected()
Used to determine if any fatal errors have been reported through this listener since it was constructed.
Copyright © 2001-2018 DeltaXML Ltd. All Rights Reserved.