public final class ScriptUtil extends Object
| Constructor and Description | 
|---|
ScriptUtil()  | 
| Modifier and Type | Method and Description | 
|---|---|
static ExecutableScript | 
getScript(String language,
         String source,
         String resource,
         ExpressionManager expressionManager)
Creates a new  
ExecutableScript from a source or resource. | 
static ExecutableScript | 
getScript(String language,
         String source,
         String resource,
         ExpressionManager expressionManager,
         ScriptFactory scriptFactory)
Creates a new  
ExecutableScript from a source or resource. | 
static ScriptFactory | 
getScriptFactory()
Returns the configured script factory in the context or a new one. 
 | 
static ExecutableScript | 
getScriptFormSource(String language,
                   String source,
                   ExpressionManager expressionManager,
                   ScriptFactory scriptFactory)
Creates a new  
ExecutableScript from a source. | 
static ExecutableScript | 
getScriptFromResource(String language,
                     String resource,
                     ExpressionManager expressionManager,
                     ScriptFactory scriptFactory)
Creates a new  
ExecutableScript from a resource. | 
static ExecutableScript | 
getScriptFromResource(String language,
                     String resource,
                     ScriptFactory scriptFactory)
Creates a new  
ExecutableScript from a static resource. | 
static ExecutableScript | 
getScriptFromResourceExpression(String language,
                               Expression resourceExpression,
                               ScriptFactory scriptFactory)
Creates a new  
ExecutableScript from a dynamic resource. | 
static ExecutableScript | 
getScriptFromSource(String language,
                   String source,
                   ScriptFactory scriptFactory)
Creates a new  
ExecutableScript from a static source. | 
static ExecutableScript | 
getScriptFromSourceExpression(String language,
                             Expression sourceExpression,
                             ScriptFactory scriptFactory)
Creates a new  
ExecutableScript from a dynamic source. | 
static boolean | 
isDynamicScriptExpression(String language,
                         String value)
Checks if the value is an expression for a dynamic script source or resource. 
 | 
public static ExecutableScript getScript(String language, String source, String resource, ExpressionManager expressionManager)
ExecutableScript from a source or resource. It excepts static and
 dynamic sources and resources. Dynamic means that the source or resource is an expression
 which will be evaluated during execution.language - the language of the scriptsource - the source code of the script or an expression which evaluates to the source coderesource - the resource path of the script code or an expression which evaluates to the resource pathexpressionManager - the expression manager to use to generate the expressions of dynamic scriptsNotValidException - if language is null or empty or both of source and resource are null or emptypublic static ExecutableScript getScript(String language, String source, String resource, ExpressionManager expressionManager, ScriptFactory scriptFactory)
ExecutableScript from a source or resource. It excepts static and
 dynamic sources and resources. Dynamic means that the source or resource is an expression
 which will be evaluated during execution.language - the language of the scriptsource - the source code of the script or an expression which evaluates to the source coderesource - the resource path of the script code or an expression which evaluates to the resource pathexpressionManager - the expression manager to use to generate the expressions of dynamic scriptsscriptFactory - the script factory used to create the scriptNotValidException - if language is null or empty or both of source and resource are invalidpublic static ExecutableScript getScriptFormSource(String language, String source, ExpressionManager expressionManager, ScriptFactory scriptFactory)
ExecutableScript from a source. It excepts static and dynamic sources.
 Dynamic means that the source is an expression which will be evaluated during execution.language - the language of the scriptsource - the source code of the script or an expression which evaluates to the source codeexpressionManager - the expression manager to use to generate the expressions of dynamic scriptsscriptFactory - the script factory used to create the scriptNotValidException - if language is null or empty or source is nullpublic static ExecutableScript getScriptFromSource(String language, String source, ScriptFactory scriptFactory)
ExecutableScript from a static source.language - the language of the scriptsource - the source code of the scriptscriptFactory - the script factory used to create the scriptNotValidException - if language is null or empty or source is nullpublic static ExecutableScript getScriptFromSourceExpression(String language, Expression sourceExpression, ScriptFactory scriptFactory)
ExecutableScript from a dynamic source. Dynamic means that the source
 is an expression which will be evaluated during execution.language - the language of the scriptsourceExpression - the expression which evaluates to the source codescriptFactory - the script factory used to create the scriptNotValidException - if language is null or empty or sourceExpression is nullpublic static ExecutableScript getScriptFromResource(String language, String resource, ExpressionManager expressionManager, ScriptFactory scriptFactory)
ExecutableScript from a resource. It excepts static and dynamic resources.
 Dynamic means that the resource is an expression which will be evaluated during execution.language - the language of the scriptresource - the resource path of the script code or an expression which evaluates to the resource pathexpressionManager - the expression manager to use to generate the expressions of dynamic scriptsscriptFactory - the script factory used to create the scriptNotValidException - if language or resource are null or emptypublic static ExecutableScript getScriptFromResource(String language, String resource, ScriptFactory scriptFactory)
ExecutableScript from a static resource.language - the language of the scriptresource - the resource path of the script codescriptFactory - the script factory used to create the scriptNotValidException - if language or resource are null or emptypublic static ExecutableScript getScriptFromResourceExpression(String language, Expression resourceExpression, ScriptFactory scriptFactory)
ExecutableScript from a dynamic resource. Dynamic means that the source
 is an expression which will be evaluated during execution.language - the language of the scriptresourceExpression - the expression which evaluates to the resource pathscriptFactory - the script factory used to create the scriptNotValidException - if language is null or empty or resourceExpression is nullpublic static boolean isDynamicScriptExpression(String language, String value)
language - the language of the scriptvalue - the value to checkpublic static ScriptFactory getScriptFactory()
Copyright © 2018. All rights reserved.