| java.lang.Object org.springframework.scripting.bsh.BshScriptUtils
BshScriptUtils | abstract public class BshScriptUtils (Code) | | Utility methods for handling BeanShell-scripted objects.
author: Rob Harrop author: Juergen Hoeller since: 2.0 |
Method Summary | |
public static Object | createBshObject(String scriptSource) Create a new BeanShell-scripted object from the given script source. | public static Object | createBshObject(String scriptSource, Class[] scriptInterfaces) Create a new BeanShell-scripted object from the given script source,
using the default ClassLoader. | public static Object | createBshObject(String scriptSource, Class[] scriptInterfaces, ClassLoader classLoader) Create a new BeanShell-scripted object from the given script source. | static Class | determineBshObjectType(String scriptSource) Evaluate the specified BeanShell script based on the given script source,
returning the Class defined by the script. | static Object | evaluateBshScript(String scriptSource, Class[] scriptInterfaces, ClassLoader classLoader) Evaluate the specified BeanShell script based on the given script source,
keeping a returned script Class or script Object as-is. |
createBshObject | public static Object createBshObject(String scriptSource) throws EvalError(Code) | | Create a new BeanShell-scripted object from the given script source.
With this createBshObject variant, the script needs to
declare a full class or return an actual instance of the scripted object.
Parameters: scriptSource - the script source text the scripted Java object throws: EvalError - in case of BeanShell parsing failure |
createBshObject | public static Object createBshObject(String scriptSource, Class[] scriptInterfaces) throws EvalError(Code) | | 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).
Parameters: scriptSource - the script source text Parameters: scriptInterfaces - the interfaces that the scripted Java object issupposed to implement (may be null or empty if the script itselfdeclares a full class or returns an actual instance of the scripted object) the scripted Java object throws: EvalError - in case of BeanShell parsing failure See Also: BshScriptUtils.createBshObject(String,Class[],ClassLoader) |
createBshObject | public static Object createBshObject(String scriptSource, Class[] scriptInterfaces, ClassLoader classLoader) throws EvalError(Code) | | 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).
Parameters: scriptSource - the script source text Parameters: scriptInterfaces - the interfaces that the scripted Java object issupposed to implement (may be null or empty if the script itselfdeclares a full class or returns an actual instance of the scripted object) Parameters: classLoader - the ClassLoader to create the script proxy with the scripted Java object throws: EvalError - in case of BeanShell parsing failure |
determineBshObjectType | static Class determineBshObjectType(String scriptSource) throws EvalError(Code) | | Evaluate the specified BeanShell script based on the given script source,
returning the Class defined by the script.
The script may either declare a full class or return an actual instance of
the scripted object (in which case the Class of the object will be returned).
In any other case, the returned Class will be null .
Parameters: scriptSource - the script source text the scripted Java class, or null if none could be determined throws: EvalError - in case of BeanShell parsing failure |
evaluateBshScript | static Object evaluateBshScript(String scriptSource, Class[] scriptInterfaces, ClassLoader classLoader) throws EvalError(Code) | | Evaluate the specified BeanShell script based on the given script source,
keeping a returned script Class or script Object as-is.
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).
Parameters: scriptSource - the script source text Parameters: scriptInterfaces - the interfaces that the scripted Java object issupposed to implement (may be null or empty if the script itselfdeclares a full class or returns an actual instance of the scripted object) Parameters: classLoader - the ClassLoader to create the script proxy with the scripted Java class or Java object throws: EvalError - in case of BeanShell parsing failure |
|
|