Class JavaAdapter

    • Constructor Detail

      • JavaAdapter

        public JavaAdapter()
    • Method Detail

      • convertResult

        public static java.lang.Object convertResult​(java.lang.Object result,
                                                     java.lang.Class<?> c)
      • createAdapterWrapper

        public static Scriptable createAdapterWrapper​(Scriptable obj,
                                                      java.lang.Object adapter)
      • getAdapterSelf

        public 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
      • writeAdapterObject

        public static void writeAdapterObject​(java.lang.Object javaObject,
                                              java.io.ObjectOutputStream out)
                                       throws java.io.IOException
        Throws:
        java.io.IOException
      • readAdapterObject

        public 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
      • createAdapterCode

        public static byte[] createAdapterCode​(ObjToIntMap functionNames,
                                               java.lang.String adapterName,
                                               java.lang.Class<?> superClass,
                                               java.lang.Class<?>[] interfaces,
                                               java.lang.String scriptClassName)
      • getFunction

        public static Function getFunction​(Scriptable obj,
                                           java.lang.String functionName)
      • callMethod

        public 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.