Class JShellErrorEvent

java.lang.Object
java.util.EventObject
com.github.fracpete.jshell.event.JShellErrorEvent
All Implemented Interfaces:
Serializable

public class JShellErrorEvent extends EventObject
Event that gets sent if an error occurred during JShell execution.
Author:
FracPete (fracpete at waikato dot ac dot nz)
See Also:
  • Field Details

    • m_Message

      protected String m_Message
      the error message.
    • m_Exception

      protected Throwable m_Exception
      the optional exception.
  • Constructor Details

    • JShellErrorEvent

      public JShellErrorEvent(JShellExec source, String message)
      Initializes the error message with no exception.
      Parameters:
      source - the source of the error
      message - the error message
    • JShellErrorEvent

      public JShellErrorEvent(JShellExec source, String message, Throwable exception)
      Initializes the error message.
      Parameters:
      source - the source of the error
      message - the error message
      exception - the optional execption
  • Method Details

    • getMessage

      public String getMessage()
      Returns the message.
      Returns:
      the message
    • hasException

      public boolean hasException()
      Checks whether an exception is available.
      Returns:
      true if exception available
    • getException

      public Throwable getException()
      Returns the exception.
      Returns:
      the exception, null if none available
    • toString

      public String toString()
      Returns a string representation of the event.
      Overrides:
      toString in class EventObject
      Returns:
      the representation