ptolemy.moml
Class StreamErrorHandler
java.lang.Object
ptolemy.moml.StreamErrorHandler
- All Implemented Interfaces:
- ErrorHandler
- public class StreamErrorHandler
- extends java.lang.Object
- implements ErrorHandler
Basic error handler for the MoMLParser class. This error handler reports
errors to a stream or to standard error, and requests that parsing continue.
- Since:
- Ptolemy II 2.0
- Version:
- $Id: StreamErrorHandler.java,v 1.14 2004/04/13 05:12:57 cxh Exp $
- Author:
- Edward A. Lee
- See Also:
MoMLParser
- Accepted Rating:
- Proposed Rating:
|
Constructor Summary |
StreamErrorHandler()
Create an error handler that sends messages to the standard error. |
StreamErrorHandler(java.io.OutputStream out)
Create an error handler that sends messages to the specified stream. |
|
Method Summary |
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 printing a description of the error to
the stream specified in the constructor. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
StreamErrorHandler
public StreamErrorHandler()
- Create an error handler that sends messages to the standard error.
StreamErrorHandler
public StreamErrorHandler(java.io.OutputStream out)
- Create an error handler that sends messages to the specified stream.
enableErrorSkipping
public void enableErrorSkipping(boolean enable)
- Enable or disable skipping of errors. This method does nothing.
- Specified by:
enableErrorSkipping in interface ErrorHandler
- 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 printing a description of the error to
the stream specified in the constructor.
- Specified by:
handleError in interface ErrorHandler
- Parameters:
element - The XML element that triggered the error.context - The container object for the element.exception - The exception that was thrown.
- Returns:
- CONTINUE to request skipping this element.