Elide GraalVM25.6.0-elide.4
All types
Versions and modules

InlineSnippet

Javaclassin org.graalvm.polyglot.tcksince 0.32

public final class InlineSnippet
Inheritance
  1. Object
  2. InlineSnippet

The unit of execution with an inline source. The InlineSnippet represents an execution of a script and an associated inline source code that is to be executed at script's locations.

It's recommended to provide two snippets at least, one with local variables and restricted location predicate and one with globally accessible code and no location predicate.

Methods6

Snippet getScript()

getScript

since 0.32
public Snippet getScript()

Returns a script to be executed. The source code is executed inlined in this script.

Returns

Snippet
No description.
CharSequence getCode()

getCode

since 0.32
public CharSequence getCode()

Returns an inline source code that is to be executed at specific locations, or at all statement and call locations if the predicate is null.

Returns

CharSequence
No description.
Predicate<SourceSection> getLocationPredicate()

getLocationPredicate

since 0.32
public Predicate<SourceSection> getLocationPredicate()

Returns a testing predicate for locations at which source code is executed.

Returns

Predicate<SourceSection>
the predicate that returns true for SourceSections where the source code is to be executed, or null if the source code should be executed at all instrumentable statement and call locations.
ResultVerifier getResultVerifier()

getResultVerifier

since 0.32
public ResultVerifier getResultVerifier()

Returns the ResultVerifier to verify the result of source code execution.

Returns

ResultVerifier
either a custom or the default ResultVerifier.
String toString()Described in toString().

toString

since 0.32
public String toString()

Described in toString().

Returns

String
No description.
static InlineSnippet.Builder newBuilder(Snippet, CharSequence)

newBuilder

staticsince 0.32
public static InlineSnippet.Builder newBuilder(Snippet script, CharSequence code)

Creates a new InlineSnippet builder object.

Parameters

scriptSnippet
the script to execute (use Snippet.newBuilder(String, Value, TypeDescriptor) to create one)
codeCharSequence
the inline source code that is to be executed inside the script

Nested types

Inherited members