public final class JavaAdapter extends java.lang.Object implements IdFunctionCall
Constructor and Description |
---|
JavaAdapter() |
Modifier and Type | Method and Description |
---|---|
static java.lang.Object |
callMethod(ContextFactory factory,
Scriptable thisObj,
Function f,
java.lang.Object[] args,
long argsToWrap)
Utility method which dynamically binds a Context to the current thread,
if none already exists.
|
static java.lang.Object |
convertResult(java.lang.Object result,
java.lang.Class<?> c) |
static byte[] |
createAdapterCode(ObjToIntMap functionNames,
java.lang.String adapterName,
java.lang.Class<?> superClass,
java.lang.Class<?>[] interfaces,
java.lang.String scriptClassName) |
static Scriptable |
createAdapterWrapper(Scriptable obj,
java.lang.Object adapter) |
java.lang.Object |
execIdCall(IdFunctionObject f,
Context cx,
Scriptable scope,
Scriptable thisObj,
java.lang.Object[] args)
'thisObj' will be null if invoked as constructor, in which case
instance of Scriptable should be returned
|
static java.lang.Object |
getAdapterSelf(java.lang.Class<?> adapterClass,
java.lang.Object adapter) |
static Function |
getFunction(Scriptable obj,
java.lang.String functionName) |
static void |
init(Context cx,
Scriptable scope,
boolean sealed) |
static java.lang.Object |
readAdapterObject(Scriptable self,
java.io.ObjectInputStream in) |
static Scriptable |
runScript(Script script) |
static void |
writeAdapterObject(java.lang.Object javaObject,
java.io.ObjectOutputStream out) |
public static void init(Context cx, Scriptable scope, boolean sealed)
public java.lang.Object execIdCall(IdFunctionObject f, Context cx, Scriptable scope, Scriptable thisObj, java.lang.Object[] args)
IdFunctionCall
execIdCall
in interface IdFunctionCall
public static java.lang.Object convertResult(java.lang.Object result, java.lang.Class<?> c)
public static Scriptable createAdapterWrapper(Scriptable obj, java.lang.Object adapter)
public static java.lang.Object getAdapterSelf(java.lang.Class<?> adapterClass, java.lang.Object adapter) throws java.lang.NoSuchFieldException, java.lang.IllegalAccessException
java.lang.NoSuchFieldException
java.lang.IllegalAccessException
public static void writeAdapterObject(java.lang.Object javaObject, java.io.ObjectOutputStream out) throws java.io.IOException
java.io.IOException
public static java.lang.Object readAdapterObject(Scriptable self, java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException
java.io.IOException
java.lang.ClassNotFoundException
public static byte[] createAdapterCode(ObjToIntMap functionNames, java.lang.String adapterName, java.lang.Class<?> superClass, java.lang.Class<?>[] interfaces, java.lang.String scriptClassName)
public static Function getFunction(Scriptable obj, java.lang.String functionName)
public static java.lang.Object callMethod(ContextFactory factory, Scriptable thisObj, Function f, java.lang.Object[] args, long argsToWrap)
public static Scriptable runScript(Script script)