public final class ScriptTools
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static boolean |
containsParameterReferences(Script script)
Returns whether the given script contains parameter references.
|
static boolean |
hasParameterDeclaration(java.lang.String string)
Returns
true if the given string is a script declaration and
contains at least the parentheses of the parameter declaration are present;
false otherwise. |
static boolean |
isScript(java.lang.String string)
Returns whether the given string is a script declaration (identified by its
prefix).
|
static Script |
parseScriptDeclaration(java.lang.String script)
Parses the given script declaration in its string form and returns it as
object where the components are easily accessible.
|
static Script |
parseScriptDeclaration(java.lang.String script,
boolean paramRefsAllowed)
Parses the given script declaration in its string form and returns it as
object where the components are easily accessible.
|
static Script |
resolveParameterReferences(Script script,
java.util.Map<java.lang.String,java.io.Serializable> paramValues)
Resolves the parameter references of the given script using the available
values.
|
public static boolean isScript(java.lang.String string)
string - the string to be testedpublic static boolean hasParameterDeclaration(java.lang.String string)
true if the given string is a script declaration and
contains at least the parentheses of the parameter declaration are present;
false otherwise.string - the string to be testedpublic static Script parseScriptDeclaration(java.lang.String script) throws ScriptException
script - the script declarationScriptException - if the script declaration could not be parsedpublic static Script parseScriptDeclaration(java.lang.String script, boolean paramRefsAllowed) throws ScriptException
script - the script declarationparamRefsAllowed - whether parameter references are allowedScriptException - if the script declaration could not be parsed; if
parameter references are encountered but no allowedpublic static boolean containsParameterReferences(Script script)
script - the script to be testedpublic static Script resolveParameterReferences(Script script, java.util.Map<java.lang.String,java.io.Serializable> paramValues) throws ScriptException
script - the script containing parameter referencesparamValues - the available parameter valuesScriptException - if not all parameter references could be resolved