public class EngineUtils
extends java.lang.Object
| Constructor and Description |
|---|
EngineUtils() |
| Modifier and Type | Method and Description |
|---|---|
static void |
addEventListener(java.lang.Object bean,
java.lang.String eventSetName,
java.lang.String filter,
BSFEngine engine,
BSFManager manager,
java.lang.String source,
int lineNo,
int columnNo,
java.lang.Object script)
Add a script as a listener to some event coming out of an object.
|
static java.lang.Object |
callBeanMethod(java.lang.Object bean,
java.lang.String methodName,
java.lang.Object[] args)
Finds and invokes a method with the given signature on the given
bean.
|
static java.lang.Object |
createBean(java.lang.String className,
java.lang.Object[] args)
Creates a new bean.
|
static java.lang.String |
getTypeSignatureString(java.lang.Class cl)
Given a class return the type signature string fragment for it.
|
static java.lang.Class |
loadClass(BSFManager mgr,
java.lang.String name)
Load a class using the class loader of given manager.
|
public static void addEventListener(java.lang.Object bean,
java.lang.String eventSetName,
java.lang.String filter,
BSFEngine engine,
BSFManager manager,
java.lang.String source,
int lineNo,
int columnNo,
java.lang.Object script)
throws BSFException
bean - event sourceeventSetName - name of event set from event src to bind tofilter - filter for eventsengine - BSFEngine which can run this scriptmanager - BSFManager of the above enginesource - (context info) the source of this expression
(e.g., filename)lineNo - (context info) the line number in source for exprcolumnNo - (context info) the column number in source for exprscript - the script to execute when the event occursBSFException - if anything goes wrong while running the scriptpublic static java.lang.Object callBeanMethod(java.lang.Object bean,
java.lang.String methodName,
java.lang.Object[] args)
throws BSFException
bean - the object on which to invoke the methodmethodName - name of the methodargs - arguments to be given to the methodBSFException - if something goes wrongpublic static java.lang.Object createBean(java.lang.String className,
java.lang.Object[] args)
throws BSFException
className - fully qualified name of class to instantiateargs - array of constructor args (or null if none)BSFException - if something goes wrong (@see
org.apache.cs.util.MethodUtils for the real
exceptions that can occur).public static java.lang.String getTypeSignatureString(java.lang.Class cl)
cl - class object for whom the signature fragment is needed.public static java.lang.Class loadClass(BSFManager mgr, java.lang.String name) throws BSFException
mgr - BSFManager who's classLoader and tempDir props are
consultedname - name of the class to loadBSFException - if something goes wrong.