| java.lang.Object org.mozilla.javascript.VMBridge
All known Subclasses: org.mozilla.javascript.jdk13.VMBridge_jdk13, org.mozilla.javascript.jdk11.VMBridge_jdk11,
VMBridge | abstract public class VMBridge (Code) | | |
Method Summary | |
abstract protected Context | getContext(Object contextHelper) Get
Context instance associated with the current thread
or null if none. | abstract protected ClassLoader | getCurrentThreadClassLoader() Return the ClassLoader instance associated with the current thread. | protected Object | getInterfaceProxyHelper(ContextFactory cf, Class[] interfaces) Create helper object to create later proxies implementing the specified
interfaces later. | public Iterator | getJavaIterator(Context cx, Scriptable scope, Object obj) If "obj" is a java.util.Iterator or a java.lang.Iterable, return a
wrapping as a JavaScript Iterator. | abstract protected Object | getThreadContextHelper() Return a helper object to optimize
Context access. | abstract protected boolean | isVarArgs(Member member) Returns whether or not a given member (method or constructor)
has variable arguments. | protected Object | newInterfaceProxy(Object proxyHelper, ContextFactory cf, InterfaceAdapter adapter, Object target, Scriptable topScope) Create proxy object for
InterfaceAdapter . | abstract protected void | setContext(Object contextHelper, Context cx) Associate
Context instance with the current thread or remove
the current association if cx is null. | abstract protected boolean | tryToMakeAccessible(Object accessibleObject) In many JVMSs, public methods in private
classes are not accessible by default (Sun Bug #4071593). |
getCurrentThreadClassLoader | abstract protected ClassLoader getCurrentThreadClassLoader()(Code) | | Return the ClassLoader instance associated with the current thread.
|
getInterfaceProxyHelper | protected Object getInterfaceProxyHelper(ContextFactory cf, Class[] interfaces)(Code) | | Create helper object to create later proxies implementing the specified
interfaces later. Under JDK 1.3 the implementation can look like:
return java.lang.reflect.Proxy.getProxyClass(..., interfaces).
getConstructor(new Class[] {
java.lang.reflect.InvocationHandler.class });
Parameters: interfaces - Array with one or more interface class objects. |
getJavaIterator | public Iterator getJavaIterator(Context cx, Scriptable scope, Object obj)(Code) | | If "obj" is a java.util.Iterator or a java.lang.Iterable, return a
wrapping as a JavaScript Iterator. Otherwise, return null.
This method is in VMBridge since Iterable is a JDK 1.5 addition.
|
isVarArgs | abstract protected boolean isVarArgs(Member member)(Code) | | Returns whether or not a given member (method or constructor)
has variable arguments.
Variable argument methods have only been supported in Java since
JDK 1.5.
|
tryToMakeAccessible | abstract protected boolean tryToMakeAccessible(Object accessibleObject)(Code) | | In many JVMSs, public methods in private
classes are not accessible by default (Sun Bug #4071593).
VMBridge instance should try to workaround that via, for example,
calling method.setAccessible(true) when it is available.
The implementation is responsible to catch all possible exceptions
like SecurityException if the workaround is not available.
true if it was possible to make method accessibleor false otherwise. |
|
|