类 BshScriptUtils
java.lang.Object
cn.taketoday.scripting.bsh.BshScriptUtils
Utility methods for handling BeanShell-scripted objects.
- 从以下版本开始:
- 4.0
- 作者:
- Rob Harrop, Juergen Hoeller
-
嵌套类概要
嵌套类修饰符和类型类说明static final classException to be thrown on script execution failure. -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明static ObjectcreateBshObject(String scriptSource) Create a new BeanShell-scripted object from the given script source.static ObjectcreateBshObject(String scriptSource, Class<?>... scriptInterfaces) Create a new BeanShell-scripted object from the given script source, using the default ClassLoader.static ObjectcreateBshObject(String scriptSource, Class<?>[] scriptInterfaces, ClassLoader classLoader) Create a new BeanShell-scripted object from the given script source.
-
构造器详细资料
-
BshScriptUtils
public BshScriptUtils()
-
-
方法详细资料
-
createBshObject
Create a new BeanShell-scripted object from the given script source.With this
createBshObjectvariant, the script needs to declare a full class or return an actual instance of the scripted object.- 参数:
scriptSource- the script source text- 返回:
- the scripted Java object
- 抛出:
bsh.EvalError- in case of BeanShell parsing failure
-
createBshObject
public static Object createBshObject(String scriptSource, @Nullable Class<?>... scriptInterfaces) throws bsh.EvalError Create a new BeanShell-scripted object from the given script source, using the default ClassLoader.The script may either be a simple script that needs a corresponding proxy generated (implementing the specified interfaces), or declare a full class or return an actual instance of the scripted object (in which case the specified interfaces, if any, need to be implemented by that class/instance).
- 参数:
scriptSource- the script source textscriptInterfaces- the interfaces that the scripted Java object is supposed to implement (may benullor empty if the script itself declares a full class or returns an actual instance of the scripted object)- 返回:
- the scripted Java object
- 抛出:
bsh.EvalError- in case of BeanShell parsing failure- 另请参阅:
-
createBshObject
public static Object createBshObject(String scriptSource, @Nullable Class<?>[] scriptInterfaces, @Nullable ClassLoader classLoader) throws bsh.EvalError Create a new BeanShell-scripted object from the given script source.The script may either be a simple script that needs a corresponding proxy generated (implementing the specified interfaces), or declare a full class or return an actual instance of the scripted object (in which case the specified interfaces, if any, need to be implemented by that class/instance).
- 参数:
scriptSource- the script source textscriptInterfaces- the interfaces that the scripted Java object is supposed to implement (may benullor empty if the script itself declares a full class or returns an actual instance of the scripted object)classLoader- the ClassLoader to use for evaluating the script- 返回:
- the scripted Java object
- 抛出:
bsh.EvalError- in case of BeanShell parsing failure
-