InlineSnippet
public final class InlineSnippet- Inheritance
ObjectInlineSnippet
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.32public 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.32public 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.32public Predicate< SourceSection> getLocationPredicate()Returns a testing predicate for locations at which source code is executed.
Returns
Predicate<SourceSection> - the predicate that returns
trueforSourceSections where thesource codeis to be executed, ornullif the source code should be executed at all instrumentable statement and call locations.
ResultVerifier getResultVerifier()
getResultVerifier
since 0.32public 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().
static InlineSnippet.Builder newBuilder(Snippet, CharSequence)
newBuilder
staticsince 0.32public 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
Returns
InlineSnippet.Builder- the new
Builder
Nested types
public static final class .BuilderThe builder of an
InlineSnippet.