Uses of Class
jdk.jshell.Snippet
Package
Description
Provides interfaces for creating tools, such as a Read-Eval-Print Loop (REPL),
which interactively evaluate "snippets" of Java programming language code.
-
Uses of Snippet in jdk.jshell
Modifier and TypeClassDescriptionclass
Grouping for all declaration Snippets: variable declarations (VarSnippet
), method declarations (MethodSnippet
), and type declarations (TypeDeclSnippet
).class
A snippet of code that is not valid Java programming language code.class
Snippet for an assignment or variable-value expression.class
Snippet for an import declaration.class
Snippet for a method definition.class
Grouping for Snippets which persist and influence future code.class
Snippet for a statement.class
Snippet for a type definition (a class, interface, enum, or annotation interface definition).class
Snippet for a variable definition.Modifier and TypeMethodDescriptionSnippetEvent.causeSnippet()
Either the snippet whose change caused this update ornull
.SnippetEvent.snippet()
The Snippet which has changedModifier and TypeMethodDescriptionabstract Collection<Snippet>
SourceCodeAnalysis.dependents(Snippet snippet)
Returns a collection ofSnippet
s which might need updating if the givenSnippet
is updated.JShell.snippets()
Return all snippets.SourceCodeAnalysis.sourceToSnippets(String input)
Converts the source code of a snippet into aSnippet
object (or list ofSnippet
objects in the case of some var declarations, e.g.: int x, y, z;).Modifier and TypeMethodDescriptionabstract Collection<Snippet>
SourceCodeAnalysis.dependents(Snippet snippet)
Returns a collection ofSnippet
s which might need updating if the givenSnippet
is updated.JShell.diagnostics(Snippet snippet)
Return the diagnostics of the most recent evaluation of the snippet.Remove a declaration from the state.Return the status of the snippet.abstract SourceCodeAnalysis.SnippetWrapper
Returns the wrapper information for theSnippet
.Modifier and TypeMethodDescriptionJShell.Builder.idGenerator(BiFunction<Snippet,Integer,String> generator)
Sets the generator of identifying names for Snippets.