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. |
Exception |
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()
Has the signature changed? Coming in or out of definition
(status.isDefined) is always a signature change.
|
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.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 Exception 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-04-14-195246.buildd.src