亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? javaadapter.java

?? 主要的怎么樣結合java 和 javascript!
?? JAVA
?? 第 1 頁 / 共 3 頁
字號:
                if (Modifier.isStatic(mods) || Modifier.isFinal(mods)) {                    continue;                }                String methodName = method.getName();                Class[] argTypes = method.getParameterTypes();                if (!functionNames.has(methodName)) {                    try {                        superClass.getMethod(methodName, argTypes);                        // The class we're extending implements this method and                        // the JavaScript object doesn't have an override. See                        // bug 61226.                        continue;                    } catch (NoSuchMethodException e) {                        // Not implemented by superclass; fall through                    }                }                // make sure to generate only one instance of a particular                // method/signature.                String methodSignature = getMethodSignature(method, argTypes);                String methodKey = methodName + methodSignature;                if (! generatedOverrides.has(methodKey)) {                    generateMethod(cfw, adapterName, methodName,                                   argTypes, method.getReturnType());                    generatedOverrides.put(methodKey, 0);                    generatedMethods.put(methodName, 0);                }            }        }        // Now, go through the superclasses methods, checking for abstract        // methods or additional methods to override.        // generate any additional overrides that the object might contain.        Method[] methods = superClass.getMethods();        for (int j = 0; j < methods.length; j++) {            Method method = methods[j];            int mods = method.getModifiers();            if (Modifier.isStatic(mods) || Modifier.isFinal(mods))                continue;            // if a method is marked abstract, must implement it or the            // resulting class won't be instantiable. otherwise, if the object            // has a property of the same name, then an override is intended.            boolean isAbstractMethod = Modifier.isAbstract(mods);            String methodName = method.getName();            if (isAbstractMethod || functionNames.has(methodName)) {                // make sure to generate only one instance of a particular                // method/signature.                Class[] argTypes = method.getParameterTypes();                String methodSignature = getMethodSignature(method, argTypes);                String methodKey = methodName + methodSignature;                if (! generatedOverrides.has(methodKey)) {                    generateMethod(cfw, adapterName, methodName,                                   argTypes, method.getReturnType());                    generatedOverrides.put(methodKey, 0);                    generatedMethods.put(methodName, 0);                }                // if a method was overridden, generate a "super$method"                // which lets the delegate call the superclass' version.                if (!isAbstractMethod) {                    generateSuper(cfw, adapterName, superName,                                  methodName, methodSignature,                                  argTypes, method.getReturnType());                }            }        }        // Generate Java methods for remaining properties that are not        // overrides.        ObjToIntMap.Iterator iter = new ObjToIntMap.Iterator(functionNames);        for (iter.start(); !iter.done(); iter.next()) {            String functionName = (String)iter.getKey();            if (generatedMethods.has(functionName))                continue;            int length = iter.getValue();            Class[] parms = new Class[length];            for (int k=0; k < length; k++)                parms[k] = ScriptRuntime.ObjectClass;            generateMethod(cfw, adapterName, functionName, parms,                           ScriptRuntime.ObjectClass);        }        return cfw.toByteArray();    }    static Class loadAdapterClass(String className, byte[] classBytes)    {        GeneratedClassLoader loader            = SecurityController.createLoader(null, null);        Class result = loader.defineClass(className, classBytes);        loader.linkClass(result);        return result;    }    public static Function getFunction(Scriptable obj, String functionName)    {        Object x = ScriptableObject.getProperty(obj, functionName);        if (x == Scriptable.NOT_FOUND) {            // This method used to swallow the exception from calling            // an undefined method. People have come to depend on this            // somewhat dubious behavior. It allows people to avoid            // implementing listener methods that they don't care about,            // for instance.            return null;        }        if (!(x instanceof Function))            throw ScriptRuntime.notFunctionError(x, functionName);        return (Function)x;    }    /**     * Utility method which dynamically binds a Context to the current thread,     * if none already exists.     */    public static Object callMethod(ContextFactory factory,                                    final Scriptable thisObj,                                    final Function f, final Object[] args,                                    final long argsToWrap)    {        if (f == null) {            // See comments in getFunction            return Undefined.instance;        }        if (factory == null) {            factory = ContextFactory.getGlobal();        }        final Scriptable scope = f.getParentScope();        if (argsToWrap == 0) {            return Context.call(factory, f, scope, thisObj, args);        }        Context cx = Context.getCurrentContext();        if (cx != null) {            return doCall(cx, scope, thisObj, f, args, argsToWrap);        } else {            return factory.call(new ContextAction() {                public Object run(Context cx)                {                    return doCall(cx, scope, thisObj, f, args, argsToWrap);                }            });        }    }    private static Object doCall(Context cx, Scriptable scope,                                 Scriptable thisObj, Function f,                                 Object[] args, long argsToWrap)    {        // Wrap the rest of objects        for (int i = 0; i != args.length; ++i) {            if (0 != (argsToWrap & (1 << i))) {                Object arg = args[i];                if (!(arg instanceof Scriptable)) {                    args[i] = cx.getWrapFactory().wrap(cx, scope, arg,                                                       null);                }            }        }        return f.call(cx, scope, thisObj, args);    }    public static Scriptable runScript(final Script script)    {        return (Scriptable)Context.call(new ContextAction() {            public Object run(Context cx)            {                ScriptableObject global = ScriptRuntime.getGlobal(cx);                script.exec(cx, global);                return global;            }        });    }    private static void generateCtor(ClassFileWriter cfw, String adapterName,                                     String superName)    {        cfw.startMethod("<init>",                        "(Lorg/mozilla/javascript/ContextFactory;"                        +"Lorg/mozilla/javascript/Scriptable;)V",                        ClassFileWriter.ACC_PUBLIC);        // Invoke base class constructor        cfw.add(ByteCode.ALOAD_0);  // this        cfw.addInvoke(ByteCode.INVOKESPECIAL, superName, "<init>", "()V");        // Save parameter in instance variable "factory"        cfw.add(ByteCode.ALOAD_0);  // this        cfw.add(ByteCode.ALOAD_1);  // first arg: ContextFactory instance        cfw.add(ByteCode.PUTFIELD, adapterName, "factory",                "Lorg/mozilla/javascript/ContextFactory;");        // Save parameter in instance variable "delegee"        cfw.add(ByteCode.ALOAD_0);  // this        cfw.add(ByteCode.ALOAD_2);  // second arg: Scriptable delegee        cfw.add(ByteCode.PUTFIELD, adapterName, "delegee",                "Lorg/mozilla/javascript/Scriptable;");        cfw.add(ByteCode.ALOAD_0);  // this for the following PUTFIELD for self        // create a wrapper object to be used as "this" in method calls        cfw.add(ByteCode.ALOAD_2);  // the Scriptable delegee        cfw.add(ByteCode.ALOAD_0);  // this        cfw.addInvoke(ByteCode.INVOKESTATIC,                      "org/mozilla/javascript/JavaAdapter",                      "createAdapterWrapper",                      "(Lorg/mozilla/javascript/Scriptable;"                      +"Ljava/lang/Object;"                      +")Lorg/mozilla/javascript/Scriptable;");        cfw.add(ByteCode.PUTFIELD, adapterName, "self",                "Lorg/mozilla/javascript/Scriptable;");        cfw.add(ByteCode.RETURN);        cfw.stopMethod((short)3); // 3: this + factory + delegee    }    private static void generateSerialCtor(ClassFileWriter cfw,                                           String adapterName,                                           String superName)    {        cfw.startMethod("<init>",                        "(Lorg/mozilla/javascript/ContextFactory;"                        +"Lorg/mozilla/javascript/Scriptable;"                        +"Lorg/mozilla/javascript/Scriptable;"                        +")V",                        ClassFileWriter.ACC_PUBLIC);        // Invoke base class constructor        cfw.add(ByteCode.ALOAD_0);  // this        cfw.addInvoke(ByteCode.INVOKESPECIAL, superName, "<init>", "()V");        // Save parameter in instance variable "factory"        cfw.add(ByteCode.ALOAD_0);  // this        cfw.add(ByteCode.ALOAD_1);  // first arg: ContextFactory instance        cfw.add(ByteCode.PUTFIELD, adapterName, "factory",                "Lorg/mozilla/javascript/ContextFactory;");        // Save parameter in instance variable "delegee"        cfw.add(ByteCode.ALOAD_0);  // this        cfw.add(ByteCode.ALOAD_2);  // second arg: Scriptable delegee        cfw.add(ByteCode.PUTFIELD, adapterName, "delegee",                "Lorg/mozilla/javascript/Scriptable;");        // save self        cfw.add(ByteCode.ALOAD_0);  // this        cfw.add(ByteCode.ALOAD_3);  // second arg: Scriptable self        cfw.add(ByteCode.PUTFIELD, adapterName, "self",                "Lorg/mozilla/javascript/Scriptable;");        cfw.add(ByteCode.RETURN);        cfw.stopMethod((short)4); // 4: this + factory + delegee + self    }    private static void generateEmptyCtor(ClassFileWriter cfw,                                          String adapterName,                                          String superName,                                          String scriptClassName)    {        cfw.startMethod("<init>", "()V", ClassFileWriter.ACC_PUBLIC);        // Invoke base class constructor        cfw.add(ByteCode.ALOAD_0);  // this        cfw.addInvoke(ByteCode.INVOKESPECIAL, superName, "<init>", "()V");        // Set factory to null to use current global when necessary        cfw.add(ByteCode.ACONST_NULL);        cfw.add(ByteCode.PUTFIELD, adapterName, "factory",                "Lorg/mozilla/javascript/ContextFactory;");        // Load script class        cfw.add(ByteCode.NEW, scriptClassName);        cfw.add(ByteCode.DUP);        cfw.addInvoke(ByteCode.INVOKESPECIAL, scriptClassName, "<init>", "()V");        // Run script and save resulting scope        cfw.addInvoke(ByteCode.INVOKESTATIC,                      "org/mozilla/javascript/JavaAdapter",                      "runScript",                      "(Lorg/mozilla/javascript/Script;"                      +")Lorg/mozilla/javascript/Scriptable;");        cfw.add(ByteCode.ASTORE_1);        // Save the Scriptable in instance variable "delegee"        cfw.add(ByteCode.ALOAD_0);  // this        cfw.add(ByteCode.ALOAD_1);  // the Scriptable        cfw.add(ByteCode.PUTFIELD, adapterName, "delegee",                "Lorg/mozilla/javascript/Scriptable;");        cfw.add(ByteCode.ALOAD_0);  // this for the following PUTFIELD for self        // create a wrapper object to be used as "this" in method calls        cfw.add(ByteCode.ALOAD_1);  // the Scriptable        cfw.add(ByteCode.ALOAD_0);  // this        cfw.addInvoke(ByteCode.INVOKESTATIC,                      "org/mozilla/javascript/JavaAdapter",                      "createAdapterWrapper",                      "(Lorg/mozilla/javascript/Scriptable;"                      +"Ljava/lang/Object;"                      +")Lorg/mozilla/javascript/Scriptable;");        cfw.add(ByteCode.PUTFIELD, adapterName, "self",                "Lorg/mozilla/javascript/Scriptable;");        cfw.add(ByteCode.RETURN);        cfw.stopMethod((short)2); // this + delegee    }    /**     * Generates code to wrap Java arguments into Object[].     * Non-primitive Java types are left as is pending convertion     * in the helper method. Leaves the array object on the top of the stack.     */    static void generatePushWrappedArgs(ClassFileWriter cfw,                                        Class[] argTypes,                                        int arrayLength)    {        // push arguments        cfw.addPush(arrayLength);        cfw.add(ByteCode.ANEWARRAY, "java/lang/Object");        int paramOffset = 1;        for (int i = 0; i != argTypes.length; ++i) {            cfw.add(ByteCode.DUP); // duplicate array reference            cfw.addPush(i);            paramOffset += generateWrapArg(cfw, paramOffset, argTypes[i]);            cfw.add(ByteCode.AASTORE);        }    }    /**     * Generates code to wrap Java argument into Object.     * Non-primitive Java types are left unconverted pending convertion     * in the helper method. Leaves the wrapper object on the top of the stack.     */    private static int generateWrapArg(ClassFileWriter cfw, int paramOffset,                                       Class argType)    {        int size = 1;        if (!argType.isPrimitive()) {            cfw.add(ByteCode.ALOAD, paramOffset);        } else if (argType == Boolean.TYPE) {            // wrap boolean values with java.lang.Boolean.            cfw.add(ByteCode.NEW, "java/lang/Boolean");            cfw.add(ByteCode.DUP);            cfw.add(ByteCode.ILOAD, paramOffset);            cfw.addInvoke(ByteCode.INVOKESPECIAL, "java/lang/Boolean",                          "<init>", "(Z)V");        } else if (argType == Character.TYPE) {            // Create a string of length 1 using the character parameter.            cfw.add(ByteCode.ILOAD, paramOffset);            cfw.addInvoke(ByteCode.INVOKESTATIC, "java/lang/String",                          "valueOf", "(C)Ljava/lang/String;");        } else {            // convert all numeric values to java.lang.Double.            cfw.add(ByteCode.NEW, "java/lang/Double");            cfw.add(ByteCode.DUP);            String typeName = argType.getName();            switch (typeName.charAt(0)) {            case 'b':            case 's':            case 'i':                // load an int value, convert to double.                cfw.add(ByteCode.ILOAD, paramOffset);

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
51久久夜色精品国产麻豆| av一区二区三区在线| 亚洲精品一区二区三区在线观看| 婷婷国产v国产偷v亚洲高清| 欧美天堂一区二区三区| 亚洲一线二线三线视频| av电影天堂一区二区在线观看| 56国语精品自产拍在线观看| 久久激情五月婷婷| 国产欧美日韩亚州综合| 色欧美片视频在线观看| 久久av资源网| 亚洲日本在线天堂| 欧美一区二区三区不卡| 国产成人在线免费观看| 亚洲一线二线三线视频| 日本一区二区三级电影在线观看 | 一级日本不卡的影视| 日韩亚洲欧美成人一区| 91视频在线看| 国产精品亚洲专一区二区三区| 一区二区三区国产豹纹内裤在线| 日韩欧美激情四射| 欧美无人高清视频在线观看| 成人午夜av电影| 六月婷婷色综合| 夜夜嗨av一区二区三区| 久久精品一区八戒影视| 日韩视频123| 国产精品国产a级| 久久天堂av综合合色蜜桃网| 色婷婷av一区二区三区软件| 麻豆国产一区二区| 亚州成人在线电影| 中文字幕欧美一| 国产婷婷色一区二区三区| 欧美一区二区精品在线| 欧美在线观看一区二区| 一本大道久久a久久综合婷婷| 国产成人免费av在线| 韩国成人福利片在线播放| 亚洲成av人片一区二区三区| 一区二区不卡在线视频 午夜欧美不卡在| 久久久国际精品| 久久久久久日产精品| 日韩欧美三级在线| 日韩精品一区在线| 久久综合色之久久综合| 26uuu久久天堂性欧美| 久久一夜天堂av一区二区三区| 日韩欧美中文字幕制服| 精品欧美久久久| 国产女人18毛片水真多成人如厕 | 久久99精品久久久久久久久久久久 | 精品亚洲国产成人av制服丝袜| 午夜精品一区二区三区电影天堂| 亚洲不卡在线观看| 欧美bbbbb| 国产精品一品二品| 亚洲激情网站免费观看| 欧美国产精品中文字幕| 欧美激情一区二区三区全黄 | av电影在线观看一区| 91福利视频网站| 欧美日本一道本| 日韩欧美亚洲另类制服综合在线| 国产丝袜在线精品| 亚洲激情中文1区| 免费高清不卡av| 成人在线综合网| 欧美日韩精品福利| 久久婷婷成人综合色| 亚洲免费伊人电影| 美女视频黄 久久| jlzzjlzz国产精品久久| 欧美一区二区三区四区久久| 国产欧美精品一区二区三区四区 | 国产精品美女视频| 日一区二区三区| 91亚洲国产成人精品一区二区三| 91精品婷婷国产综合久久性色 | 日本在线不卡一区| www.欧美日韩| 久久精品人人做人人综合| 夜夜嗨av一区二区三区四季av| 国产精品中文有码| 91麻豆精品91久久久久同性| 国产精品国产三级国产aⅴ无密码 国产精品国产三级国产aⅴ原创 | 丝袜a∨在线一区二区三区不卡| 国产一区日韩二区欧美三区| 欧美日韩国产高清一区二区三区| 中文字幕永久在线不卡| 久久精品国产99久久6| 欧美视频第二页| 亚洲欧美中日韩| 成人18视频在线播放| 久久亚洲综合av| 韩国成人在线视频| 欧美一区二区三区视频免费播放| 亚洲精品久久7777| 99国产精品久久久久久久久久久| 国产欧美一区二区精品忘忧草| 日韩精品1区2区3区| 精品视频全国免费看| 亚洲欧美偷拍卡通变态| 97久久久精品综合88久久| 国产精品国产自产拍高清av王其 | 亚洲最大的成人av| 91搞黄在线观看| 亚洲午夜免费福利视频| 日本黄色一区二区| 91福利精品视频| 成人精品高清在线| 中文字幕成人av| 成人免费高清视频| 亚洲人成7777| 欧美中文一区二区三区| 亚洲国产精品一区二区久久恐怖片| 色综合中文字幕| 一区二区在线观看av| 欧美日韩国产综合草草| 青青草伊人久久| 久久久www免费人成精品| 福利一区在线观看| 亚洲人成7777| 欧美精品视频www在线观看| 老司机午夜精品99久久| 国产欧美一区二区精品忘忧草| 色婷婷综合中文久久一本| 亚洲男人天堂av| 成人av网站大全| 亚洲私人黄色宅男| 884aa四虎影成人精品一区| 国产一区二区三区| 一区二区三区中文字幕精品精品| 欧美在线观看一二区| 久久99精品一区二区三区三区| 国产日本欧洲亚洲| 在线成人av网站| 国产999精品久久久久久绿帽| 亚洲影视在线播放| 国产日韩综合av| 69久久99精品久久久久婷婷| 粉嫩嫩av羞羞动漫久久久| 亚洲国产日韩av| 自拍偷拍亚洲激情| 2023国产精华国产精品| 欧美三级在线播放| 成年人午夜久久久| 久久国产日韩欧美精品| 一区av在线播放| 亚洲欧美日韩国产手机在线| 精品精品国产高清一毛片一天堂| 色一区在线观看| 懂色一区二区三区免费观看| 秋霞国产午夜精品免费视频| 亚洲一区二区视频| 中文字幕一区在线观看视频| 久久久亚洲精品石原莉奈| 日韩一区二区三区四区| 色婷婷综合视频在线观看| 国产福利不卡视频| 久久爱另类一区二区小说| 亚洲六月丁香色婷婷综合久久 | 在线精品视频一区二区| av成人动漫在线观看| 成人免费看片app下载| 国产激情精品久久久第一区二区 | 欧美mv日韩mv国产| 欧美一区二区三区公司| 欧美一区二区三区不卡| 欧美综合一区二区| 欧美性三三影院| 欧美网站大全在线观看| 欧美视频一区二区在线观看| 日本乱码高清不卡字幕| 91九色最新地址| 欧美午夜影院一区| 91精品国产麻豆国产自产在线| 日韩一区二区三| 久久综合中文字幕| 日韩毛片视频在线看| 亚洲午夜三级在线| 卡一卡二国产精品| 国产精品91一区二区| 国产综合色产在线精品| 成人小视频在线| 欧美三级在线看| 欧美成人福利视频| 国产精品不卡在线| 亚洲123区在线观看| 国产高清不卡二三区| 色狠狠一区二区| 欧美变态口味重另类| 中文在线免费一区三区高中清不卡| 一区二区三区在线不卡| 毛片不卡一区二区| 97aⅴ精品视频一二三区| 欧美一区二区福利视频| 亚洲欧美自拍偷拍色图|