Package ptolemy.moml.test
Class RecorderErrorHandler
- java.lang.Object
-
- ptolemy.moml.test.RecorderErrorHandler
-
- All Implemented Interfaces:
ErrorHandler
public class RecorderErrorHandler extends java.lang.Object implements ErrorHandler
Record MoML Errors and retrieve them later.- Since:
- Ptolemy II 4.0
- Version:
- $Id$
- Author:
- Christopher Hylands Brooks
- See Also:
RecorderListener
- Pt.AcceptedRating:
- Red (reviewmoderator)
- Pt.ProposedRating:
- Red (eal)
-
-
Field Summary
-
Fields inherited from interface ptolemy.moml.ErrorHandler
CANCEL, CONTINUE, RETHROW
-
-
Constructor Summary
Constructors Constructor Description RecorderErrorHandler()
Create an error handler.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
enableErrorSkipping(boolean enable)
Enable or disable skipping of errors.java.lang.String
getMessages()
Get the messages recorded so far.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.void
reset()
Clear the buffer.
-
-
-
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.
-
getMessages
public java.lang.String getMessages()
Get the messages recorded so far.- Returns:
- The messages.
-
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 interfaceErrorHandler
- 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.
-
reset
public void reset()
Clear the buffer.
-
-