public final class ScriptContextBuilder extends Object
ScriptContext
.Constructor and Description |
---|
ScriptContextBuilder()
Creates an empty builder.
|
ScriptContextBuilder(String scriptLanguage,
String scriptText)
Creates a builder with the required parameters specified.
|
Modifier and Type | Method and Description |
---|---|
ScriptContextBuilder |
addScriptArgument(String name,
Object value)
Adds or sets an argument to pass to the script.
|
ScriptContext |
build()
Creates a
ScriptContext . |
Map<String,Object> |
getScriptArguments()
Returns a mutable reference of the script arguments map.
|
String |
getScriptLanguage()
Identifies the language in which the script is written (e.g.,
bash , csh , Perl4 or
Python ). |
String |
getScriptText()
Returns the actual characters of the script.
|
void |
removeScriptArgument(String name)
Removes the given script argument.
|
ScriptContextBuilder |
setScriptLanguage(String scriptLanguage)
Sets the script language.
|
ScriptContextBuilder |
setScriptText(String scriptText)
Sets the actual characters of the script.
|
public ScriptContextBuilder()
public ScriptContextBuilder(String scriptLanguage, String scriptText)
scriptLanguage
- a string that identifies the language in which the script is
written (e.g., bash
, csh
,
Perl4
or Python
).scriptText
- The text (i.e., actual characters) of the script.public String getScriptLanguage()
bash
, csh
, Perl4
or
Python
).public ScriptContextBuilder setScriptLanguage(String scriptLanguage)
scriptLanguage
- The script languagepublic String getScriptText()
public ScriptContextBuilder setScriptText(String scriptText)
scriptText
- The actual characters of the script.public ScriptContextBuilder addScriptArgument(String name, Object value)
name
- The name of the argument. Must not be null.value
- The value of the argument. Must be one of type types that the
framework can serialize.for a list of supported types.
public void removeScriptArgument(String name)
name
- The name of the argument. Must not be null.public Map<String,Object> getScriptArguments()
public ScriptContext build()
ScriptContext
. The scriptLanguage
and
scriptText
must be set prior to calling this.ScriptContext
.Copyright © 2019. All rights reserved.