Examples of startMethod()


Examples of org.mozilla.classfile.ClassFileWriter.startMethod()

                "<init>", "()", "V");
        cfw.add(ByteCode.RETURN);
        cfw.stopMethod((short)1, null); // one argument -- this???

        // Add the invoke() method call
        cfw.startMethod("invoke",
                        "(Ljava/lang/Object;[Ljava/lang/Object;)"+
                         "Ljava/lang/Object;",
                        (short)(ClassFileWriter.ACC_PUBLIC |
                                ClassFileWriter.ACC_FINAL));
View Full Code Here

Examples of org.mozilla.classfile.ClassFileWriter.startMethod()

                                "org.mozilla.javascript.Invoker", "");
        cfw.setFlags((short)(ClassFileWriter.ACC_PUBLIC |
                             ClassFileWriter.ACC_FINAL));

        // Add our instantiator!
        cfw.startMethod("<init>", "()V", ClassFileWriter.ACC_PUBLIC);
        cfw.add(ByteCode.ALOAD_0);
        cfw.add(ByteCode.INVOKESPECIAL,
                "org.mozilla.javascript.Invoker",
                "<init>", "()", "V");
        cfw.add(ByteCode.RETURN);
View Full Code Here

Examples of org.mozilla.classfile.ClassFileWriter.startMethod()

    {
        String secureCallerClassName = SecureCaller.class.getName();
        ClassFileWriter cfw = new ClassFileWriter(
                secureCallerClassName + "Impl", secureCallerClassName,
                "<generated>");
        cfw.startMethod("<init>", "()V", ClassFileWriter.ACC_PUBLIC);
        cfw.addALoad(0);
        cfw.addInvoke(ByteCode.INVOKESPECIAL, secureCallerClassName,
                "<init>", "()V");
        cfw.add(ByteCode.RETURN);
        cfw.stopMethod((short)1);
View Full Code Here

Examples of org.mozilla.classfile.ClassFileWriter.startMethod()

            "Lorg/mozilla/javascript/Context;" +
            "Lorg/mozilla/javascript/Scriptable;" +
            "Lorg/mozilla/javascript/Scriptable;" +
            "[Ljava/lang/Object;)Ljava/lang/Object;";

        cfw.startMethod("call",
                "(Lorg/mozilla/javascript/Callable;" + callableCallSig,
                (short)(ClassFileWriter.ACC_PUBLIC
                        | ClassFileWriter.ACC_FINAL));
        for(int i = 1; i < 6; ++i) {
            cfw.addALoad(i);
View Full Code Here

Examples of org.mozilla.classfile.ClassFileWriter.startMethod()

            Collections.addAll(methods, clazz.getMethods());
        }

        cfw.addField("events", adapterSignature, (short) (ACC_PRIVATE | ACC_FINAL));

        cfw.startMethod("<init>", "(" + adapterSignature + ")V", ACC_PUBLIC);
        // Invoke base class constructor
        cfw.addLoadThis();
        cfw.addInvoke(ByteCode.INVOKESPECIAL, superName, "<init>", "()V");
        cfw.addLoadThis();
        cfw.add(ByteCode.ALOAD_1)// event adapter
View Full Code Here

Examples of org.mozilla.classfile.ClassFileWriter.startMethod()

            for (Class<?> c : paramTypes) {
                // adjust locals length for long and double parameters
                if (c == Double.TYPE || c == Long.TYPE) ++localsLength;
            }
            Class<?>returnType = method.getReturnType();
            cfw.startMethod(methodName, getSignature(paramTypes, returnType), ACC_PUBLIC);
            cfw.addLoadThis();
            cfw.add(ByteCode.GETFIELD, cfw.getClassName(), "events", adapterSignature);
            cfw.addLoadConstant(eventName); // event type
            cfw.addLoadConstant(paramLength)// create args array
            cfw.add(ByteCode.ANEWARRAY, "java/lang/Object");
View Full Code Here

Examples of org.mozilla.classfile.ClassFileWriter.startMethod()

                                "org.mozilla.javascript.Invoker", "");
        cfw.setFlags((short)(ClassFileWriter.ACC_PUBLIC |
                             ClassFileWriter.ACC_FINAL));

        // Add our instantiator!
        cfw.startMethod("<init>", "()V", ClassFileWriter.ACC_PUBLIC);
        cfw.add(ByteCode.ALOAD_0);
        cfw.add(ByteCode.INVOKESPECIAL,
                "org.mozilla.javascript.Invoker",
                "<init>", "()", "V");
        cfw.add(ByteCode.RETURN);
View Full Code Here

Examples of org.mozilla.classfile.ClassFileWriter.startMethod()

                "<init>", "()", "V");
        cfw.add(ByteCode.RETURN);
        cfw.stopMethod((short)1, null); // one argument -- this???

        // Add the invoke() method call
        cfw.startMethod("invoke",
                        "(Ljava/lang/Object;[Ljava/lang/Object;)"+
                         "Ljava/lang/Object;",
                        (short)(ClassFileWriter.ACC_PUBLIC |
                                ClassFileWriter.ACC_FINAL));
View Full Code Here

Examples of org.mozilla.classfile.ClassFileWriter.startMethod()

    {
        String secureCallerClassName = SecureCaller.class.getName();
        ClassFileWriter cfw = new ClassFileWriter(
                secureCallerClassName + "Impl", secureCallerClassName,
                "<generated>");
        cfw.startMethod("<init>", "()V", ClassFileWriter.ACC_PUBLIC);
        cfw.addALoad(0);
        cfw.addInvoke(ByteCode.INVOKESPECIAL, secureCallerClassName,
                "<init>", "()V");
        cfw.add(ByteCode.RETURN);
        cfw.stopMethod((short)1);
View Full Code Here

Examples of org.mozilla.classfile.ClassFileWriter.startMethod()

            "Lorg/mozilla/javascript/Context;" +
            "Lorg/mozilla/javascript/Scriptable;" +
            "Lorg/mozilla/javascript/Scriptable;" +
            "[Ljava/lang/Object;)Ljava/lang/Object;";
       
        cfw.startMethod("call",
                "(Lorg/mozilla/javascript/Callable;" + callableCallSig,
                (short)(ClassFileWriter.ACC_PUBLIC
                        | ClassFileWriter.ACC_FINAL));
        for(int i = 1; i < 6; ++i) {
            cfw.addALoad(i);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.