Package org.mozilla.javascript
Class JavaAdapter
java.lang.Object
org.mozilla.javascript.JavaAdapter
- All Implemented Interfaces:
IdFunctionCall
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic 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.static Object
convertResult
(Object result, Class<?> c) static byte[]
createAdapterCode
(Map<String, Integer> functionNames, String adapterName, Class<?> superClass, Class<?>[] interfaces, String scriptClassName) static Scriptable
createAdapterWrapper
(Scriptable obj, Object adapter) execIdCall
(IdFunctionObject f, Context cx, Scriptable scope, Scriptable thisObj, Object[] args) 'thisObj' will be null if invoked as constructor, in which case instance of Scriptable should be returnedstatic Object
getAdapterSelf
(Class<?> adapterClass, Object adapter) static Function
getFunction
(Scriptable obj, String functionName) static void
init
(Context cx, Scriptable scope, boolean sealed) static Object
readAdapterObject
(Scriptable self, ObjectInputStream in) static Scriptable
static void
writeAdapterObject
(Object javaObject, ObjectOutputStream out)
-
Constructor Details
-
JavaAdapter
public JavaAdapter()
-
-
Method Details
-
init
-
execIdCall
public Object execIdCall(IdFunctionObject f, Context cx, Scriptable scope, Scriptable thisObj, Object[] args) Description copied from interface:IdFunctionCall
'thisObj' will be null if invoked as constructor, in which case instance of Scriptable should be returned- Specified by:
execIdCall
in interfaceIdFunctionCall
-
convertResult
-
createAdapterWrapper
-
getAdapterSelf
public static Object getAdapterSelf(Class<?> adapterClass, Object adapter) throws NoSuchFieldException, IllegalAccessException -
writeAdapterObject
- Throws:
IOException
-
readAdapterObject
public static Object readAdapterObject(Scriptable self, ObjectInputStream in) throws IOException, ClassNotFoundException - Throws:
IOException
ClassNotFoundException
-
createAdapterCode
-
getFunction
-
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. -
runScript
-