Package com.github.fracpete.jshell.event
Class JShellErrorEvent
java.lang.Object
java.util.EventObject
com.github.fracpete.jshell.event.JShellErrorEvent
- All Implemented Interfaces:
Serializable
Event that gets sent if an error occurred during JShell execution.
- Author:
- FracPete (fracpete at waikato dot ac dot nz)
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Throwablethe optional exception.protected Stringthe error message.Fields inherited from class java.util.EventObject
source -
Constructor Summary
ConstructorsConstructorDescriptionJShellErrorEvent(JShellExec source, String message) Initializes the error message with no exception.JShellErrorEvent(JShellExec source, String message, Throwable exception) Initializes the error message. -
Method Summary
Modifier and TypeMethodDescriptionReturns the exception.Returns the message.booleanChecks whether an exception is available.toString()Returns a string representation of the event.Methods inherited from class java.util.EventObject
getSource
-
Field Details
-
m_Message
the error message. -
m_Exception
the optional exception.
-
-
Constructor Details
-
JShellErrorEvent
Initializes the error message with no exception.- Parameters:
source- the source of the errormessage- the error message
-
JShellErrorEvent
Initializes the error message.- Parameters:
source- the source of the errormessage- the error messageexception- the optional execption
-
-
Method Details
-
getMessage
Returns the message.- Returns:
- the message
-
hasException
public boolean hasException()Checks whether an exception is available.- Returns:
- true if exception available
-
getException
Returns the exception.- Returns:
- the exception, null if none available
-
toString
Returns a string representation of the event.- Overrides:
toStringin classEventObject- Returns:
- the representation
-