Interface SnippetOutcome
- All Known Subinterfaces:
SnippetOutcome.CompilerErrors,SnippetOutcome.CompilerSemanticErrors,SnippetOutcome.CompilerSyntaxErrors,SnippetOutcome.ControlViolation,SnippetOutcome.ExceptionThrown,SnippetOutcome.Interrupted,SnippetOutcome.Overwritten,SnippetOutcome.Successful,SnippetOutcome.SuccessfulNoValue,SnippetOutcome.SuccessfulWithValue,SnippetOutcome.Suspended,SnippetOutcome.UnresolvedReferences
public sealed interface SnippetOutcome
permits SnippetOutcome.CompilerErrors, SnippetOutcome.ControlViolation, SnippetOutcome.UnresolvedReferences, SnippetOutcome.Overwritten, SnippetOutcome.Suspended, SnippetOutcome.Interrupted, SnippetOutcome.ExceptionThrown, SnippetOutcome.Successful (not exhaustive)
Captures the outcome from one of the
Snippets that constitute a JavaBox script.
A snippet can fail by failing to compile, compiling into bytecode that violates a Control,
throwing an exception during execution, etc.
For some outcomes that implement SnippetOutcome.HasSnippet, additional information is available
via the associated JShell snippet.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceIndicates failure due to one or more compiler errors.static interfaceIndicates failure due to one or more compiler semantic errors.static interfaceIndicates failure due to one or more compiler parsing/syntax errors.static interfaceIndicates that the bytecode generated by the snippet could not be loaded because it violated someControl.static interfaceIndicates an exception was thrown during the execution of the snippet.static interfaceImplemented bySnippetOutcomes that will cause a script to stop executing.static interfaceSnippetOutcome.HasException<T extends Throwable>Implemented bySnippetOutcomes for which there is an associated exception.static interfaceImplemented bySnippetOutcomes for which enough progress was made to define a JShellSnippet.static interfaceIndicates that the snippet's execution was interrupted.static interfaceIndicates that a declaration was successfully compiled, but the declaration was overwritten by a later snippet in the same source.static interfaceIndicates a successful outcome.static interfaceIndicates a successful outcome for which no value was returned, e.g., the invocation of a void method, the declaration for which no unresolved references remain, etc.static interfaceIndicates a successful outcome for which some value was returned, e.g., an evaluated expression or the invocation of a non-void method.static interfaceIndicates that the snippet invokedJavaBox.suspend().static interfaceIndicates that a declaration was successful but it contained unresolved references and those references were not resolved by any subsequent snippets in the same source. -
Method Summary
-
Method Details
-
box
-
source
-
offset
LineAndColumn offset()Get the position within the original script source of thesource()associated with this instance.- Returns:
- snippet source offset in original script
- See Also:
-