Package org.mozilla.javascript
Class JavaAdapter
java.lang.Object
org.mozilla.javascript.JavaAdapter
- All Implemented Interfaces:
IdFunctionCall
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic 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(Map<String, Integer> functionNames, String adapterName, Class<?> superClass, Class<?>[] interfaces, String scriptClassName) static ScriptablecreateAdapterWrapper(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 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 Scriptablestatic voidwriteAdapterObject(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:
execIdCallin 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:
IOExceptionClassNotFoundException
-
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
-