Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES All Classes
SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD

ptolemy.moml
Interface ErrorHandler

All Known Implementing Classes:
MoMLApplication.IgnoreErrorHandler, StreamErrorHandler, VergilErrorHandler

public interface ErrorHandler

Interface for error handlers for the MoMLParser class.

Since:
Ptolemy II 1.0
Version:
$Id: ErrorHandler.java,v 1.19 2006年03月29日 00:02:50 cxh Exp $
Author:
Edward A. Lee
See Also:
MoMLParser
Accepted Rating:
Red (reviewmoderator)
Proposed Rating:
Red (eal)

Field Summary
static int CANCEL
Indicator to cancel parsing XML.
static int CONTINUE
Indicator to skip this element and continue parsing XML.
static int RETHROW
Indicator to request that the exception be rethrown.
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.

Field Detail

CONTINUE

public static final int CONTINUE
Indicator to skip this element and continue parsing XML.

See Also:
Constant Field Values

CANCEL

public static final int CANCEL
Indicator to cancel parsing XML.

See Also:
Constant Field Values

RETHROW

public static final int RETHROW
Indicator to request that the exception be rethrown.

See Also:
Constant Field Values
Method Detail

enableErrorSkipping

public void enableErrorSkipping(boolean enable)
Enable or disable skipping of errors. If this method is called with a true argument, then an implementation of this interface may ignore subsequent errors by returning CONTINUE in handleError() without reporting the error. If it is called with a false argument, then the implementation is expected to report all subsequent errors (but it is not required to do so).

This method is intended to be used when an operation may trigger a large number of errors, and the user interface wishes to offer the user the option of ignoring them. This method should be called with a true argument before the operation begins, and then called with a false argument after the operation ends.

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.

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 skip this element, CANCEL to abort processing of the XML, or RETHROW to request that the exception be rethrown.

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES All Classes
SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD

AltStyle によって変換されたページ (->オリジナル) /