类 GroovyScriptRuntime
java.lang.Object
com.codingapi.springboot.script.GroovyScriptRuntime
groovy script 执行上下文对象
-
构造器详细资料
-
GroovyScriptRuntime
public GroovyScriptRuntime(int maxCacheSize)
-
-
方法详细资料
-
clearCache
public void clearCache()清空缓存对象 -
cacheSize
public int cacheSize()缓存大小 -
compile
编译脚本- 参数:
script- 脚本内容cache- 是否缓存
-
compile
编译脚本,非缓存模式- 参数:
script- 脚本内容
-
invoke
public <T> T invoke(String method, String script, Class<T> returnType, Map<String, Object> binds, Object... args) 执行函数脚本- 参数:
method- 函数名称script- 脚本内容returnType- 返回类型binds- 绑定数据对象args- 函数参数- 返回:
- 返回数据
-
invoke
执行函数脚本- 参数:
method- 函数名称script- 脚本内容returnType- 返回类型args- 函数参数- 返回:
- 返回数据
-
invoke
public <T> T invoke(String method, String script, Class<T> returnType, TransactionMode transactionMode, Map<String, Object> binds, Object... args) 执行函数脚本- 参数:
method- 函数名称script- 脚本内容returnType- 返回类型transactionMode- 事务模式binds- 绑定数据对象args- 函数参数- 返回:
- 返回数据
-
run
执行脚本- 参数:
script- 脚本returnType- 返回数据类型binds- 绑定对象- 返回:
- 返回数据
-
run
public <T> T run(String script, Class<T> returnType, TransactionMode transactionMode, Map<String, Object> binds) 执行脚本- 参数:
script- 脚本returnType- 返回数据类型transactionMode- 事务模式binds- 绑定对象- 返回:
- 返回数据
-