Package ptolemy.moml
Class SimpleErrorHandler
- java.lang.Object
-
- ptolemy.moml.SimpleErrorHandler
-
- All Implemented Interfaces:
ErrorHandler
public class SimpleErrorHandler extends java.lang.Object implements ErrorHandler
Simple error handler for the MoMLParser class. This error handler reports errors by throwing an exception.- Since:
- Ptolemy II 10.0
- Version:
- $Id$
- Author:
- Christopher Brooks, based on StreamErrorHandler by Edward A. Lee
- See Also:
MoMLParser
- Pt.AcceptedRating:
- Red (cxh)
- Pt.ProposedRating:
- Red (cxh)
-
-
Field Summary
-
Fields inherited from interface ptolemy.moml.ErrorHandler
CANCEL, CONTINUE, RETHROW
-
-
Constructor Summary
Constructors Constructor Description SimpleErrorHandler()
Create an error handler that throws an exception.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
enableErrorSkipping(boolean enable)
Enable or disable skipping of errors.int
handleError(java.lang.String element, NamedObj context, java.lang.Throwable exception)
Handle an error by throwing an exception.
-
-
-
Method Detail
-
enableErrorSkipping
public void enableErrorSkipping(boolean enable)
Enable or disable skipping of errors. This method does nothing.- Specified by:
enableErrorSkipping
in interfaceErrorHandler
- Parameters:
enable
- True to enable skipping, false to disable.
-
handleError
public int handleError(java.lang.String element, NamedObj context, java.lang.Throwable exception)
Handle an error by throwing an exception.- Specified by:
handleError
in interfaceErrorHandler
- Parameters:
element
- The XML element that triggered the error.context
- The container object for the element.exception
- The exception that was thrown.- Returns:
- Never returns.
-
-