public class SnippetEvent extends Object
JShell.eval(String)
or
JShell.drop(PersistentSnippet)
,
or indirectly by these same methods as
dependencies change or Snippets are overwritten. For direct changes, the
causeSnippet()
is null
.
SnippetEvent
is immutable: an access to
any of its methods will always return the same result.
and thus is thread-safe.
Modifier and Type | Method and Description |
---|---|
Snippet |
causeSnippet()
Either the snippet whose change caused this update or
null . |
JShellException |
exception()
An instance of
UnresolvedReferenceException , if an unresolved reference was
encountered, or an instance of EvalException if an exception was thrown
during execution, otherwise null . |
boolean |
isSignatureChange()
Indicates whether the signature has changed.
|
Snippet.Status |
previousStatus()
The status before the transition.
|
Snippet |
snippet()
The Snippet which has changed
|
Snippet.Status |
status()
The after status.
|
String |
toString()
Return a string representation of the event
|
String |
value()
The result value of successful run.
|
public Snippet snippet()
Status
has changed.public Snippet.Status previousStatus()
NONEXISTENT
.public Snippet.Status status()
Status
change.public boolean isSignatureChange()
(status == OVERWRITTEN)
is always false
as responsibility for the
definition has passed to the overwriting definition.true
if the signature changed; otherwise false
public Snippet causeSnippet()
null
. This returns null
if this change is the
creation of a new Snippet via
eval
or it is the
explicit drop of a Snippet with
drop
.null
if
directly caused by an API action.public JShellException exception()
UnresolvedReferenceException
, if an unresolved reference was
encountered, or an instance of EvalException
if an exception was thrown
during execution, otherwise null
.null
.public String value()
null
.
Copyright © 2015, 2016, Oracle and/or its affiliates. All rights reserved.
DRAFT 9-internal+0-2016-08-10-220919.robert.dev