public abstract class AbstractScript
extends java.lang.Object
This class provides static factory methods to create script instances from either a raw script source string or from an XML Element definition. It handles the parsing, compilation, and execution of scripts in a unified way, supporting various scripting languages like BeanShell and Groovy.
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
RM_DEFAULT
A constant string for the default return mode, which is "script".
|
static java.lang.String |
RM_RESULT
A constant string for a return mode of "result".
|
static java.lang.String |
RM_SCRIPT
A constant string for a return mode of "script".
|
static java.lang.String |
SL_BEANSHELL
A constant string for the "beanshell" scripting language.
|
static java.lang.String |
SL_DEFAULT
A constant string for the default scripting language, which is "beanshell".
|
static java.lang.String |
SL_GROOVY
A constant string for the "groovy" scripting language.
|
static java.lang.String[] |
STR_VALUES_FALSE
An array of strings considered to represent a boolean "false" value.
|
static java.lang.String[] |
STR_VALUES_TRUE
An array of strings considered to represent a boolean "true" value.
|
Constructor and Description |
---|
AbstractScript() |
Modifier and Type | Method and Description |
---|---|
boolean |
asBool(java.lang.Object o,
boolean nullValue)
Converts an object to a boolean.
|
java.lang.String |
asString(java.lang.Object o,
java.lang.String nullValue)
Converts an object to a string.
|
abstract void |
clear()
Frees all variables of this script after execution to prevent them
from being held "forever" and causing memory leaks.
|
void |
close()
Closes this script instance, freeing up resources.
|
void |
compileNT()
Compiles the script if it has not been compiled yet.
|
void |
compileNT(int lineOffset)
Compiles the script with a specified line offset.
|
abstract void |
compileNT(int lineOffset,
java.lang.String errorTip)
Compiles the script with a specified line offset and error tip.
|
abstract ScriptFunctionI |
createFunction(java.lang.String src,
java.lang.String[] parmNames,
java.lang.Class[] parmTypes,
java.lang.Class returnType)
Creates a function from a script source string.
|
abstract ScriptFunctionI |
createFunction(java.lang.String src,
java.lang.String[] parmNames,
java.lang.Class[] parmTypes,
java.lang.Class returnType,
java.lang.String scriptName,
java.lang.String functionName)
Creates a function from a script source string.
|
abstract ScriptFunctionI |
createFunction(java.lang.String src,
java.lang.String[] parmNames,
java.lang.Class[] parmTypes,
java.lang.Class returnType,
java.lang.String scriptName,
java.lang.String functionName,
int lineOffset)
Creates a function from a script source string.
|
abstract ScriptFunctionI |
createFunction(java.lang.String src,
java.lang.String[] parmNames,
java.lang.Class[] parmTypes,
java.lang.Class returnType,
java.lang.String scriptName,
java.lang.String functionName,
int lineOffset,
java.lang.Object delegate)
Creates a function from a script source string.
|
boolean |
evalAsBoolNT(java.lang.String source)
Evaluates a string as a script and returns the result as boolean.
|
boolean |
evalAsBoolNT(java.lang.String source,
boolean nullValue)
Evaluates a string as a script with a specified null value and returns the result as boolean.
|
boolean |
evalAsBoolNT(java.lang.String source,
boolean nullValue,
int lineOffset)
Evaluates a string as a script with a specified null value and line offset and returns the result as boolean.
|
boolean |
evalAsBoolNT(java.lang.String source,
boolean nullValue,
int lineOffset,
java.lang.String errorTip)
Evaluates a string as a script with a specified null value and line offset and returns the result as boolean.
|
java.lang.String |
evalAsStringNT(java.lang.String source)
Parses the passed script and returns the result as String.
|
java.lang.String |
evalAsStringNT(java.lang.String source,
java.lang.String nullValue)
Evaluates a string as a script with a specified null value and returns the result as String.
|
java.lang.String |
evalAsStringNT(java.lang.String source,
java.lang.String nullValue,
int lineOffset)
Evaluates a string as a script with a specified null value and line offset and returns the result as String.
|
java.lang.String |
evalAsStringNT(java.lang.String source,
java.lang.String nullValue,
int lineOffset,
java.lang.String errorTip)
Evaluates a string as a script with a specified null value and line offset and returns the result as String.
|
java.lang.Object |
evalNT(java.lang.String source)
Evaluates a string as a script and returns the results as Object.
|
java.lang.Object |
evalNT(java.lang.String source,
java.lang.Object nullValue)
Evaluates a string as a script with a specified null value and returns the result as Object.
|
java.lang.Object |
evalNT(java.lang.String source,
java.lang.Object nullValue,
int lineOffset)
Evaluates a string as a script with a specified null value and line offset and returns the result as Object.
|
abstract java.lang.Object |
evalNT(java.lang.String source,
java.lang.Object nullValue,
int lineOffset,
java.lang.String errorTip)
Evaluates a string as a script with a specified null value and line offset and returns the result as Object.
|
static AbstractScript |
getInstance()
Creates an AbstractScript instance with a wide range of configuration options.
|
static java.lang.Object |
getInstance(electric.xml.Element el)
Creates an AbstractScript instance from an XML Element.
|
static AbstractScript |
getInstance(java.lang.String language) |
static AbstractScript |
getInstance(java.lang.String script,
boolean doPrecompile)
Creates an AbstractScript instance from a string, intelligently detecting whether the
string is an XML definition or raw script source.
|
static AbstractScript |
getInstance(java.lang.String language,
java.util.List<ScriptImport> defaultImports)
Creates an AbstractScript instance with only language and default imports.
|
static AbstractScript |
getInstance(java.lang.String language,
java.lang.String source) |
static AbstractScript |
getInstance(java.lang.String language,
java.lang.String source,
boolean doPrecompile) |
static AbstractScript |
getInstance(java.lang.String language,
java.lang.String source,
boolean doPrecompile,
AbstractScript parent) |
static AbstractScript |
getInstance(java.lang.String language,
java.lang.String source,
boolean doPrecompile,
AbstractScript parent,
java.lang.ClassLoader classLoader) |
static AbstractScript |
getInstance(java.lang.String language,
java.lang.String source,
boolean doPrecompile,
AbstractScript parent,
java.lang.ClassLoader classLoader,
java.util.Map initialVars) |
static AbstractScript |
getInstance(java.lang.String language,
java.lang.String source,
boolean doPrecompile,
AbstractScript parent,
java.lang.ClassLoader classLoader,
java.util.Map initialVars,
java.util.List<ScriptImport> defaultImports) |
static AbstractScript |
getInstance(java.lang.String language,
java.lang.String source,
boolean doPrecompile,
AbstractScript parent,
java.lang.ClassLoader classLoader,
java.util.Map initialVars,
java.util.List<ScriptImport> defaultImports,
java.lang.Class baseClass) |
static AbstractScript |
getInstance(java.lang.String language,
java.lang.String source,
boolean doPrecompile,
AbstractScript parent,
java.lang.ClassLoader classLoader,
java.util.Map initialVars,
java.util.List<ScriptImport> defaultImports,
java.lang.Class baseClass,
java.lang.String scriptName) |
static AbstractScript |
getInstance(java.lang.String language,
java.lang.String source,
boolean doPrecompile,
java.util.List<ScriptImport> defaultImports)
Creates an AbstractScript instance from various parameters, using default imports.
|
static AbstractScript |
getInstance(java.lang.String language,
java.lang.String source,
boolean doPrecompile,
java.util.List<ScriptImport> defaultImports,
java.lang.String scriptName) |
java.lang.String |
getInterrupt() |
java.lang.String |
getJavaSyntaxImports(java.util.List imports)
Generates a string of Java import statements from a list of ScriptImport objects.
|
java.lang.String |
getJavaSyntaxImports(java.util.List imports,
boolean aliasAllowed) |
abstract java.lang.String |
getLanguage()
Returns the scripting language of this script instance.
|
java.lang.Object |
getNT(java.lang.String name)
Gets the value of a variable from the script context.
|
abstract java.lang.Object |
getNT(java.lang.String name,
java.lang.Object exValue)
Gets the value of a variable from the script context.
|
abstract java.lang.String |
getSource()
Returns the source code of this script.
|
abstract boolean |
hasSource()
Checks if this script has source code.
|
static boolean |
isScriptException(java.lang.Throwable t)
Checks if a Throwable is a script-specific exception.
|
boolean |
runAsBoolNT()
Runs the script and returns the result as a boolean.
|
boolean |
runAsBoolNT(boolean nullValue)
Runs the script and returns the result as a boolean.
|
boolean |
runAsBoolNT(boolean nullValue,
int lineOffset)
Runs the script and returns the result as a boolean.
|
boolean |
runAsBoolNT(boolean nullValue,
int lineOffset,
java.lang.String errorTip)
Runs the script and returns the result as a boolean.
|
java.lang.Object |
runAsObjectNT()
Runs the script and returns the result as an object, with
null as default null value. |
java.lang.Object |
runAsObjectNT(java.lang.Object nullValue)
Runs the script with a specified default null value.
|
java.lang.Object |
runAsObjectNT(java.lang.Object nullValue,
int lineOffset)
Runs the script with a specified null value and line offset.
|
abstract java.lang.Object |
runAsObjectNT(java.lang.Object nullValue,
int lineOffset,
java.lang.String errorTip)
Runs the script with a specified null value, line offset, and error tip.
|
java.lang.String |
runAsStringNT()
Runs the script and returns the result as a string.
|
java.lang.String |
runAsStringNT(java.lang.String nullValue)
Runs the script and returns the result as a string.
|
java.lang.String |
runAsStringNT(java.lang.String nullValue,
int lineOffset)
Runs the script and returns the result as a string.
|
java.lang.String |
runAsStringNT(java.lang.String nullValue,
int lineOffset,
java.lang.String errorTip)
Runs the script and returns the result as a string.
|
void |
runNT()
Runs the script and returns its result as an object.
|
void |
runNT(int lineOffset)
Runs the script with a specified line offset.
|
void |
runNT(int lineOffset,
java.lang.String errorTip)
Runs the script with a specified line offset and error tip.
|
void |
setInterrupt(java.lang.String $10) |
abstract void |
setLineOffset(int lineOffset)
Sets an offset for line numbers, used for error reporting.
|
void |
setNT(java.util.Map map)
Sets variables from a map within a local scope.
|
void |
setNT(java.lang.String name,
boolean value)
Sets a boolean variable within a local scope.
|
void |
setNT(java.lang.String name,
boolean value,
boolean local)
Sets a boolean variable.
|
void |
setNT(java.lang.String name,
double value)
Sets a double variable within a local scope.
|
void |
setNT(java.lang.String name,
double value,
boolean local)
Sets a double variable.
|
void |
setNT(java.lang.String name,
float value)
Sets a float variable within a local scope.
|
void |
setNT(java.lang.String name,
float value,
boolean local)
Sets a float variable.
|
void |
setNT(java.lang.String name,
int value)
Sets an int variable within a local scope.
|
void |
setNT(java.lang.String name,
int value,
boolean local)
Sets an int variable.
|
void |
setNT(java.lang.String name,
long value)
Sets a long variable within a local scope.
|
void |
setNT(java.lang.String name,
long value,
boolean local)
Sets a long variable.
|
void |
setNT(java.lang.String name,
java.lang.Object value)
Sets a variable in the script context within a local scope.
|
abstract void |
setNT(java.lang.String name,
java.lang.Object value,
boolean local)
Sets a variable, optionally with local scope.
|
abstract void |
setPrecompile(boolean doPrecompile)
Sets the pre-compile flag.
|
abstract void |
setSource(java.lang.String source)
Sets the source code of this script.
|
public static final java.lang.String RM_SCRIPT
public static final java.lang.String RM_RESULT
public static final java.lang.String RM_DEFAULT
public static final java.lang.String SL_BEANSHELL
public static final java.lang.String SL_GROOVY
public static final java.lang.String SL_DEFAULT
public static final java.lang.String[] STR_VALUES_TRUE
public static final java.lang.String[] STR_VALUES_FALSE
public static AbstractScript getInstance(java.lang.String script, boolean doPrecompile)
This factory method first attempts to parse the given string as XML.
If parsing is successful, it assumes the string contains a script definition
within an XML Element and delegates to the getInstance(Element)
method.
In this case, the script's return mode is automatically set to "RM_SCRIPT"
(Return Mode Script) to return the compiled script object itself.
If XML parsing fails, the method assumes the string is the raw script source directly.
It then delegates to an overloaded getInstance
method to create a new script
instance from this raw source, optionally pre-compiling it.
script
- The input string, which can be either an XML script definition or raw script source.doPrecompile
- If true
, the script will be pre-compiled during creation.AbstractScript
instance, either compiled from the XML definition or from the raw source.public static java.lang.Object getInstance(electric.xml.Element el)
This method is a factory for creating scripts based on their XML definition. The behavior depends on the value of the "returns" attribute in the Element:
The method's design is based on the use of scripts in the "KIS" delivery simulation, where rules were defined as Business Objects derived from "JavaImp". This factory method was introduced to handle both returning the script object for later use and immediately returning its execution result.
el
- The XML Element that contains the script's definition, including language and return mode attributes.java.lang.IllegalArgumentException
- If the "returns" attribute has an unknown value.public static AbstractScript getInstance(java.lang.String language, java.lang.String source, boolean doPrecompile, java.util.List<ScriptImport> defaultImports)
language
- The scripting language to use.source
- The raw script source code.doPrecompile
- If true, the script will be pre-compiled.defaultImports
- A list of default imports to be used by the script.scriptName
- The name of the script.AbstractScript
instance.public static AbstractScript getInstance(java.lang.String language, java.lang.String source, boolean doPrecompile, java.util.List<ScriptImport> defaultImports, java.lang.String scriptName)
public static AbstractScript getInstance(java.lang.String language, java.util.List<ScriptImport> defaultImports)
language
- The scripting language to use.defaultImports
- A list of default imports to be used by the script.AbstractScript
instance.public static AbstractScript getInstance()
language
- The scripting language to use. If null, the default is used.source
- The raw script source code.doPrecompile
- If true, the script will be pre-compiled during creation.parent
- The parent script instance, used for variable inheritance.classLoader
- The ClassLoader to use for loading classes.initialVars
- A map of initial variables to be set in the script context.defaultImports
- A list of default imports to be used by the script.baseClass
- The base class to extend, for Groovy scripts.scriptName
- The name of the script, for debugging.AbstractScript
instance.java.lang.IllegalArgumentException
- If the specified language is unknown.public static AbstractScript getInstance(java.lang.String language)
public static AbstractScript getInstance(java.lang.String language, java.lang.String source)
public static AbstractScript getInstance(java.lang.String language, java.lang.String source, boolean doPrecompile)
public static AbstractScript getInstance(java.lang.String language, java.lang.String source, boolean doPrecompile, AbstractScript parent)
public static AbstractScript getInstance(java.lang.String language, java.lang.String source, boolean doPrecompile, AbstractScript parent, java.lang.ClassLoader classLoader)
public static AbstractScript getInstance(java.lang.String language, java.lang.String source, boolean doPrecompile, AbstractScript parent, java.lang.ClassLoader classLoader, java.util.Map initialVars)
public static AbstractScript getInstance(java.lang.String language, java.lang.String source, boolean doPrecompile, AbstractScript parent, java.lang.ClassLoader classLoader, java.util.Map initialVars, java.util.List<ScriptImport> defaultImports)
public static AbstractScript getInstance(java.lang.String language, java.lang.String source, boolean doPrecompile, AbstractScript parent, java.lang.ClassLoader classLoader, java.util.Map initialVars, java.util.List<ScriptImport> defaultImports, java.lang.Class baseClass)
public static AbstractScript getInstance(java.lang.String language, java.lang.String source, boolean doPrecompile, AbstractScript parent, java.lang.ClassLoader classLoader, java.util.Map initialVars, java.util.List<ScriptImport> defaultImports, java.lang.Class baseClass, java.lang.String scriptName)
public java.lang.String getJavaSyntaxImports(java.util.List imports)
imports
- A list of ScriptImport
objects.aliasAllowed
- If true, aliases for imports are included.public java.lang.String getJavaSyntaxImports(java.util.List imports, boolean aliasAllowed)
public abstract java.lang.String getLanguage()
public abstract java.lang.String getSource()
public abstract void setSource(java.lang.String source)
source
- The new source code as a String.public abstract boolean hasSource()
public abstract void setLineOffset(int lineOffset)
lineOffset
- The line offset.public abstract void setPrecompile(boolean doPrecompile)
doPrecompile
- The boolean value for the pre-compile flag.public void compileNT()
public void compileNT(int lineOffset)
lineOffset
- An integer line offset to use for error reporting.public abstract void compileNT(int lineOffset, java.lang.String errorTip)
lineOffset
- An integer line offset to use for error reporting.errorTip
- A string to use as an error message tip if compilation fails.public void close()
public abstract void clear()
public abstract ScriptFunctionI createFunction(java.lang.String src, java.lang.String[] parmNames, java.lang.Class[] parmTypes, java.lang.Class returnType)
src
- The script source code.parmNames
- An array of names for the function's parameters.parmTypes
- An array of Class objects representing the types of the function's parameters.returnType
- The Class object representing the return type of the function.ScriptFunctionI
instance representing the created function.public abstract ScriptFunctionI createFunction(java.lang.String src, java.lang.String[] parmNames, java.lang.Class[] parmTypes, java.lang.Class returnType, java.lang.String scriptName, java.lang.String functionName)
src
- The script source code.parmNames
- An array of names for the function's parameters.parmTypes
- An array of Class objects representing the types of the function's parameters.returnType
- The Class object representing the return type of the function.scriptName
- The name of the script, used for debugging and error reporting.functionName
- The name of the function.ScriptFunctionI
instance representing the created function.public abstract ScriptFunctionI createFunction(java.lang.String src, java.lang.String[] parmNames, java.lang.Class[] parmTypes, java.lang.Class returnType, java.lang.String scriptName, java.lang.String functionName, int lineOffset)
src
- The script source code.parmNames
- An array of names for the function's parameters.parmTypes
- An array of Class objects representing the types of the function's parameters.returnType
- The Class object representing the return type of the function.scriptName
- The name of the script, used for debugging and error reporting.functionName
- The name of the function.lineOffset
- An integer line offset to use for error reporting.ScriptFunctionI
instance representing the created function.public abstract ScriptFunctionI createFunction(java.lang.String src, java.lang.String[] parmNames, java.lang.Class[] parmTypes, java.lang.Class returnType, java.lang.String scriptName, java.lang.String functionName, int lineOffset, java.lang.Object delegate)
src
- The script source code.parmNames
- An array of names for the function's parameters.parmTypes
- An array of Class objects representing the types of the function's parameters.returnType
- The Class object representing the return type of the function.scriptName
- The name of the script, used for debugging and error reporting.functionName
- The name of the function.lineOffset
- An integer line offset to use for error reporting.delegate
- The object to which the function's method calls will be delegated.ScriptFunctionI
instance representing the created function.public void runNT()
public void runNT(int lineOffset)
lineOffset
- An integer line offset to use for error reporting.public void runNT(int lineOffset, java.lang.String errorTip)
lineOffset
- An integer line offset to use for error reporting.errorTip
- A string to use as an error message tip if compilation fails.public java.lang.Object runAsObjectNT()
null
as default null value.public java.lang.Object runAsObjectNT(java.lang.Object nullValue)
nullValue
- The value to return if the script returns null.public java.lang.Object runAsObjectNT(java.lang.Object nullValue, int lineOffset)
nullValue
- The value to return if the script returns null.lineOffset
- An integer line offset to use for error reporting.public abstract java.lang.Object runAsObjectNT(java.lang.Object nullValue, int lineOffset, java.lang.String errorTip)
nullValue
- The value to return if the script returns null.lineOffset
- An integer line offset to use for error reporting.errorTip
- A string to use as an error message tip if compilation fails.public java.lang.String runAsStringNT()
public java.lang.String runAsStringNT(java.lang.String nullValue)
nullValue
- The value to return if the script returns null.public java.lang.String runAsStringNT(java.lang.String nullValue, int lineOffset)
nullValue
- The value to return if the script returns null.lineOffset
- An integer line offset to use for error reporting.public java.lang.String runAsStringNT(java.lang.String nullValue, int lineOffset, java.lang.String errorTip)
nullValue
- The value to return if the script returns null.lineOffset
- An integer line offset to use for error reporting.errorTip
- A string to use as an error message tip if compilation fails.public boolean runAsBoolNT()
public boolean runAsBoolNT(boolean nullValue)
nullValue
- The value to return if the script returns null.public boolean runAsBoolNT(boolean nullValue, int lineOffset)
nullValue
- The value to return if the script returns null.lineOffset
- An integer line offset to use for error reporting.public boolean runAsBoolNT(boolean nullValue, int lineOffset, java.lang.String errorTip)
nullValue
- The value to return if the script returns null.lineOffset
- An integer line offset to use for error reporting.errorTip
- A string to use as an error message tip if compilation fails.public void setNT(java.lang.String name, java.lang.Object value)
name
- The name of the variable to set.value
- The value of the variable to set.public abstract void setNT(java.lang.String name, java.lang.Object value, boolean local)
name
- The name of the variable to set.value
- The value of the variable to set.local
- A flag indicating if the variable shall have a local scope.public void setNT(java.lang.String name, long value)
name
- The name of the variable to set.value
- The value of the variable to set.public void setNT(java.lang.String name, long value, boolean local)
name
- The name of the variable to set.value
- The value of the variable to set.local
- A flag indicating if the variable shall have a local scope.public void setNT(java.lang.String name, int value)
name
- The name of the variable to set.value
- The value of the variable to set.public void setNT(java.lang.String name, int value, boolean local)
name
- The name of the variable to set.value
- The value of the variable to set.local
- A flag indicating if the variable shall have a local scope.public void setNT(java.lang.String name, float value)
name
- The name of the variable to set.value
- The value of the variable to set.public void setNT(java.lang.String name, float value, boolean local)
name
- The name of the variable to set.value
- The value of the variable to set.local
- A flag indicating if the variable shall have a local scope.public void setNT(java.lang.String name, double value)
name
- The name of the variable to set.value
- The value of the variable to set.public void setNT(java.lang.String name, double value, boolean local)
name
- The name of the variable to set.value
- The value of the variable to set.local
- A flag indicating if the variable shall have a local scope.public void setNT(java.lang.String name, boolean value)
name
- The name of the variable to set.value
- The value of the variable to set.public void setNT(java.lang.String name, boolean value, boolean local)
name
- The name of the variable to set.value
- The value of the variable to set.local
- A flag indicating if the variable shall have a local scope.public void setNT(java.util.Map map)
map
- A map containing key value pairs representing the variable name and values to set.public java.lang.Object getNT(java.lang.String name)
name
- The name of the variable to retrieve the value of.public abstract java.lang.Object getNT(java.lang.String name, java.lang.Object exValue)
name
- The name of the variable to retrieve the value of.exValue
- This parameter is unused in all implementing classes. Maybe it was once intended to be a default value?public java.lang.Object evalNT(java.lang.String source)
source
- The source of the script to evaluate.public java.lang.Object evalNT(java.lang.String source, java.lang.Object nullValue)
source
- The source of the script to evaluate.nullValue
- The value to return if the evaluation returns null.public java.lang.Object evalNT(java.lang.String source, java.lang.Object nullValue, int lineOffset)
source
- The source of the script to evaluate.nullValue
- The value to return if the evaluation returns null.lineOffset
- An integer line offset to use for error reporting.public abstract java.lang.Object evalNT(java.lang.String source, java.lang.Object nullValue, int lineOffset, java.lang.String errorTip)
source
- The source of the script to evaluate.nullValue
- The value to return if the evaluation returns null.lineOffset
- An integer line offset to use for error reporting.errorTip
- A string to use as an error message tip if evaluation fails.public java.lang.String evalAsStringNT(java.lang.String source)
public java.lang.String evalAsStringNT(java.lang.String source, java.lang.String nullValue)
source
- The source of the script to evaluate.nullValue
- The value to return if the evaluation returns null.public java.lang.String evalAsStringNT(java.lang.String source, java.lang.String nullValue, int lineOffset)
source
- The source of the script to evaluate.nullValue
- The value to return if the evaluation returns null.lineOffset
- An integer line offset to use for error reporting.public java.lang.String evalAsStringNT(java.lang.String source, java.lang.String nullValue, int lineOffset, java.lang.String errorTip)
source
- The source of the script to evaluate.nullValue
- The value to return if the evaluation returns null.lineOffset
- An integer line offset to use for error reporting.errorTip
- A string to use as an error message tip if evaluation fails.public boolean evalAsBoolNT(java.lang.String source)
source
- The source of the script to evaluate.public boolean evalAsBoolNT(java.lang.String source, boolean nullValue)
source
- The source of the script to evaluate.nullValue
- The value to return if the evaluation returns null.public boolean evalAsBoolNT(java.lang.String source, boolean nullValue, int lineOffset)
source
- The source of the script to evaluate.nullValue
- The value to return if the evaluation returns null.lineOffset
- An integer line offset to use for error reporting.public boolean evalAsBoolNT(java.lang.String source, boolean nullValue, int lineOffset, java.lang.String errorTip)
source
- The source of the script to evaluate.nullValue
- The value to return if the evaluation returns null.lineOffset
- An integer line offset to use for error reporting.errorTip
- A string to use as an error message tip if evaluation fails.public java.lang.String asString(java.lang.Object o, java.lang.String nullValue)
o
- The Object to convert.nullValue
- The value to return if the passed object is null.public boolean asBool(java.lang.Object o, boolean nullValue)
o
- The Object to convert.nullValue
- The value to return if the passed object is null.public static boolean isScriptException(java.lang.Throwable t)
t
- The Throwable to check.true
if the throwable is an instance of a known script exception type,
false
otherwise.public java.lang.String getInterrupt()
public void setInterrupt(java.lang.String $10)
Copyright © 2000-2025 OAshi S.à r.l. All Rights Reserved.