Package org.mozilla.javascript
Class JavaAdapter
- java.lang.Object
- 
- org.mozilla.javascript.JavaAdapter
 
- 
- All Implemented Interfaces:
- IdFunctionCall
 
 public final class JavaAdapter extends java.lang.Object implements IdFunctionCall 
- 
- 
Constructor SummaryConstructors Constructor Description JavaAdapter()
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static java.lang.ObjectcallMethod(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.ObjectconvertResult(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 ScriptablecreateAdapterWrapper(Scriptable obj, java.lang.Object adapter)java.lang.ObjectexecIdCall(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 returnedstatic java.lang.ObjectgetAdapterSelf(java.lang.Class<?> adapterClass, java.lang.Object adapter)static FunctiongetFunction(Scriptable obj, java.lang.String functionName)static voidinit(Context cx, Scriptable scope, boolean sealed)static java.lang.ObjectreadAdapterObject(Scriptable self, java.io.ObjectInputStream in)static ScriptablerunScript(Script script)static voidwriteAdapterObject(java.lang.Object javaObject, java.io.ObjectOutputStream out)
 
- 
- 
- 
Method Detail- 
initpublic static void init(Context cx, Scriptable scope, boolean sealed) 
 - 
execIdCallpublic java.lang.Object execIdCall(IdFunctionObject f, Context cx, Scriptable scope, Scriptable thisObj, java.lang.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 interface- IdFunctionCall
 
 - 
convertResultpublic static java.lang.Object convertResult(java.lang.Object result, java.lang.Class<?> c)
 - 
createAdapterWrapperpublic static Scriptable createAdapterWrapper(Scriptable obj, java.lang.Object adapter) 
 - 
getAdapterSelfpublic static java.lang.Object getAdapterSelf(java.lang.Class<?> adapterClass, java.lang.Object adapter) throws java.lang.NoSuchFieldException, java.lang.IllegalAccessException- Throws:
- java.lang.NoSuchFieldException
- java.lang.IllegalAccessException
 
 - 
writeAdapterObjectpublic static void writeAdapterObject(java.lang.Object javaObject, java.io.ObjectOutputStream out) throws java.io.IOException- Throws:
- java.io.IOException
 
 - 
readAdapterObjectpublic static java.lang.Object readAdapterObject(Scriptable self, java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException - Throws:
- java.io.IOException
- java.lang.ClassNotFoundException
 
 - 
createAdapterCodepublic static byte[] createAdapterCode(ObjToIntMap functionNames, java.lang.String adapterName, java.lang.Class<?> superClass, java.lang.Class<?>[] interfaces, java.lang.String scriptClassName) 
 - 
getFunctionpublic static Function getFunction(Scriptable obj, java.lang.String functionName) 
 - 
callMethodpublic 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.
 - 
runScriptpublic static Scriptable runScript(Script script) 
 
- 
 
-