org.newsml.toolkit.conformance
Interface ErrorVisitor


public interface ErrorVisitor

Custom handler for errors and warnings.

Applications can implement this handler to control the reporting of errors and warnings through the NewsMLTestManager. By default, warnings are printed to stderr and errors cause an exception, but the user-supplied visitor can perform different actions. If the handlers throw exceptions, they will stop the conformance; otherwise, the manager will continue until the end of the tests.

Version:
2.0
Author:
Reuters PLC

Method Summary
 void error(BaseNode node, NewsMLException e)
          Report an error.
 void warning(BaseNode node, NewsMLException e)
          Report a warning.
 

Method Detail

warning

public void warning(BaseNode node,
                    NewsMLException e)
             throws NewsMLException
Report a warning.

The application can implement this method to receive notification of warnings and perform its own, customized actions in response to them. If desired, the application can throw an exception to stop the processing.

The default implementation prints the warning message to standard error and continues.

Parameters:
e - A NewsMLException containing the warning information.

error

public void error(BaseNode node,
                  NewsMLException e)
           throws NewsMLException
Report an error.

The application can implement this method to receive notification of errors and perform its own, customized actions in response to them. If desired, the application can throw an exception to stop the processing.

The default implementation rethrows the exception and stops processing.

Parameters:
e - A NewsMLException containing the error information.