Package ptolemy.moml

Class 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)
    • 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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • SimpleErrorHandler

        public SimpleErrorHandler()
        Create an error handler that throws an exception.
    • Method Detail

      • 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 throwing an exception.
        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:
        Never returns.