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.
| Modifier and Type | Class and Description |
|---|---|
| public static class | InlineSnippet.
The builder of an |
| Modifier and Type | Field and Description |
|---|---|
| private final CharSequence | |
| private final Predicate | |
| private final Snippet | |
| private final ResultVerifier |
| Access | Constructor and Description |
|---|---|
| private | InlineSnippet(final Snippet script, final CharSequence source, final Predicate<SourceSection> locationPredicate, final ResultVerifier verifier)
|
| Modifier and Type | Method and Description |
|---|---|
| public CharSequence | |
| public Predicate | Returns: the predicate that returnstrue 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.Returns a testing predicate for locations at which |
| public ResultVerifier | Returns: either a custom or the defaultResultVerifier.Returns the |
| public Snippet | |
| public static InlineSnippet. | Returns: the newBuilderthe script to execute (use
script, final CharSequence Snippet#newBuilder(String, Value, TypeDescriptor) to create one)the inline source code that is to be executed inside the script code)Creates a new |
| public String |
| code | back to summary |
|---|---|
| private final CharSequence code | |
| locationPredicate | back to summary |
|---|---|
| private final Predicate<SourceSection> locationPredicate | |
| script | back to summary |
|---|---|
| private final Snippet script | |
| verifier | back to summary |
|---|---|
| private final ResultVerifier verifier | |
| InlineSnippet | back to summary |
|---|---|
| private InlineSnippet(final Snippet script, final CharSequence source, final Predicate<SourceSection> locationPredicate, final ResultVerifier verifier) | |
| getCode | back to summary |
|---|---|
| public CharSequence getCode() Returns an inline source code that is to be executed at specific
| |
| getLocationPredicate | back to summary |
|---|---|
| public Predicate Returns a testing predicate for locations at which
| |
| getResultVerifier | back to summary |
|---|---|
| public ResultVerifier getResultVerifier() Returns the
| |
| getScript | back to summary |
|---|---|
| public Snippet getScript() Returns a script to be executed. The
| |
| newBuilder | back to summary |
|---|---|
| public static InlineSnippet. Creates a new
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non- | |
InlineSnippet.
| Modifier and Type | Field and Description |
|---|---|
| private final CharSequence | |
| private Predicate | |
| private final Snippet | |
| private ResultVerifier |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public InlineSnippet | |
| public InlineSnippet. | locationPredicate(final Predicate<SourceSection> locationPredicate)
Sets a testing predicate for locations at which the source is executed. |
| public InlineSnippet. | Returns: thisBuilderthe custom resultVerifier)ResultVerifierSets a custom verifier of a result of the |
| code | back to summary |
|---|---|
| private final CharSequence code | |
| predicate | back to summary |
|---|---|
| private Predicate<SourceSection> predicate | |
| script | back to summary |
|---|---|
| private final Snippet script | |
| verifier | back to summary |
|---|---|
| private ResultVerifier verifier | |
| Builder | back to summary |
|---|---|
| private Builder(final Snippet script, final CharSequence code) | |
| build | back to summary |
|---|---|
| public InlineSnippet build() Creates a new
| |
| locationPredicate | back to summary |
|---|---|
| public InlineSnippet. Sets a testing predicate for locations at which the source is executed. By default, the source is executed at all instrumentable statement and call locations in the script.
| |
| resultVerifier | back to summary |
|---|---|
| public InlineSnippet. Sets a custom verifier of a result of the
| |