org.mozilla.javascript

Class JavaAdapter

public final class JavaAdapter extends Object implements IdFunctionCall

Method Summary
static ObjectcallMethod(ContextFactory factory, Scriptable thisObj, Function f, Object[] args, long argsToWrap)
Utility method which dynamically binds a Context to the current thread, if none already exists.
static ObjectconvertResult(Object result, Class c)
static byte[]createAdapterCode(ObjToIntMap functionNames, String adapterName, Class superClass, Class[] interfaces, String scriptClassName)
static ScriptablecreateAdapterWrapper(Scriptable obj, Object adapter)
ObjectexecIdCall(IdFunctionObject f, Context cx, Scriptable scope, Scriptable thisObj, Object[] args)
static ObjectgetAdapterSelf(Class adapterClass, Object adapter)
static FunctiongetFunction(Scriptable obj, String functionName)
static voidinit(Context cx, Scriptable scope, boolean sealed)
static ObjectreadAdapterObject(Scriptable self, ObjectInputStream in)
static ScriptablerunScript(Script script)
static voidwriteAdapterObject(Object javaObject, ObjectOutputStream out)

Method Detail

callMethod

public static Object callMethod(ContextFactory factory, Scriptable thisObj, Function f, Object[] args, long argsToWrap)
Utility method which dynamically binds a Context to the current thread, if none already exists.

convertResult

public static Object convertResult(Object result, Class c)

createAdapterCode

public static byte[] createAdapterCode(ObjToIntMap functionNames, String adapterName, Class superClass, Class[] interfaces, String scriptClassName)

createAdapterWrapper

public static Scriptable createAdapterWrapper(Scriptable obj, Object adapter)

execIdCall

public Object execIdCall(IdFunctionObject f, Context cx, Scriptable scope, Scriptable thisObj, Object[] args)

getAdapterSelf

public static Object getAdapterSelf(Class adapterClass, Object adapter)

getFunction

public static Function getFunction(Scriptable obj, String functionName)

init

public static void init(Context cx, Scriptable scope, boolean sealed)

readAdapterObject

public static Object readAdapterObject(Scriptable self, ObjectInputStream in)

runScript

public static Scriptable runScript(Script script)

writeAdapterObject

public static void writeAdapterObject(Object javaObject, ObjectOutputStream out)