org.inria.ns.reflex.xml
Class XMLError

java.lang.Object
  extended by org.inria.ns.reflex.xml.XMLError
All Implemented Interfaces:
ErrorListener, ErrorHandler

public class XMLError
extends Object
implements ErrorHandler, ErrorListener

Reports errors on behalf of an action that fails an XML operation (XML parsing, XSLT transformation).

When an action fails, the fallback action defined by the action that fails is ran. If no fallback action that has the ID of the error (see the list below) is found, the parent of the action that fails is used to lookup for a fallback action that has the ID of the error, if any. If not found, a default fallback action is considered firstly on the action that raise the error, then on its parent.

Author:
Philippe Poulard
See Also:
XMLNames.XML_WARNING_QNAME, XMLNames.XML_ERROR_QNAME, XMLNames.XML_FATAL_ERROR_QNAME, XMLNames.XSLT_WARNING_QNAME, XMLNames.XSLT_X_ERROR_QNAME, XMLNames.XSLT_FATAL_ERROR_QNAME, Fallback, FallbackAction, LogicAction

Field Summary
static ErrorHandler INACTIVE_ERROR_HANDLER
          An error handler that ignore all errors.
 
Constructor Summary
XMLError(AbstractAction action, DataSet dataSet)
          Create a new XMLError.
 
Method Summary
 void error(SAXParseException exception)
           
 void error(TransformerException exception)
           
 void fatalError(SAXParseException exception)
           
 void fatalError(TransformerException exception)
           
 void warning(SAXParseException exception)
           
 void warning(TransformerException exception)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INACTIVE_ERROR_HANDLER

public static final ErrorHandler INACTIVE_ERROR_HANDLER
An error handler that ignore all errors.

Constructor Detail

XMLError

public XMLError(AbstractAction action,
                DataSet dataSet)
Create a new XMLError.

Parameters:
action - The action that may fail.
dataSet - The data set to use if the action fails.
Method Detail

warning

public void warning(SAXParseException exception)
             throws SAXException
Specified by:
warning in interface ErrorHandler
Throws:
SAXException

error

public void error(SAXParseException exception)
           throws SAXException
Specified by:
error in interface ErrorHandler
Throws:
SAXException

fatalError

public void fatalError(SAXParseException exception)
                throws SAXException
Specified by:
fatalError in interface ErrorHandler
Throws:
SAXException

warning

public void warning(TransformerException exception)
             throws TransformerException
Specified by:
warning in interface ErrorListener
Throws:
TransformerException

error

public void error(TransformerException exception)
           throws TransformerException
Specified by:
error in interface ErrorListener
Throws:
TransformerException

fatalError

public void fatalError(TransformerException exception)
                throws TransformerException
Specified by:
fatalError in interface ErrorListener
Throws:
TransformerException