Package org.objectweb.asm

Examples of org.objectweb.asm.ClassWriter.visitMethod()


    @Deprecated
    private ClassWriter createIndexedJavaMethodCtor(String namePath, String sup) throws Exception {
        ClassWriter cw = new ClassWriter(ClassWriter.COMPUTE_MAXS | ClassWriter.COMPUTE_FRAMES);
        cw.visit(RubyInstanceConfig.JAVA_VERSION, ACC_PUBLIC + ACC_SUPER, namePath, null, sup, null);
        cw.visitSource(namePath.replace('.', '/') + ".gen", null);
        MethodVisitor mv = cw.visitMethod(ACC_PUBLIC, "<init>", JAVA_INDEXED_SUPER_SIG, null, null);
        mv.visitCode();
        mv.visitVarInsn(ALOAD, 0);
        mv.visitVarInsn(ALOAD, 1);
        mv.visitVarInsn(ALOAD, 2);
        mv.visitVarInsn(ILOAD, 3);
View Full Code Here


            av0.visit("name", "");           
        }
        av0.visitEnd();

        // add constructor
        MethodVisitor mv = cw.visitMethod(Opcodes.ACC_PUBLIC, "<init>", "()V", null, null);
        mv.visitCode();
        Label lbegin = new Label();
        mv.visitLabel(lbegin);
        mv.visitVarInsn(Opcodes.ALOAD, 0);
        mv.visitMethodInsn(Opcodes.INVOKESPECIAL, "java/lang/Object", "<init>", "()V");
View Full Code Here

            av0.visit("name", "");           
        }
        av0.visitEnd();

        // add constructor
        MethodVisitor mv = cw.visitMethod(Opcodes.ACC_PUBLIC, "<init>", "()V", null, null);
        mv.visitCode();
        Label lbegin = new Label();
        mv.visitLabel(lbegin);
        mv.visitVarInsn(Opcodes.ALOAD, 0);
        mv.visitMethodInsn(Opcodes.INVOKESPECIAL, "java/lang/Object", "<init>", "()V");
View Full Code Here

                String beanClassCode = getClassCode(bean);
                fv = cw.visitField(0, "faultInfo", beanClassCode, null, null);
                fv.visitEnd();
                               
               
                mv = cw.visitMethod(Opcodes.ACC_PUBLIC, "<init>",
                                    "(Ljava/lang/String;" + beanClassCode + ")V", null, null);
                mv.visitCode();
                mv.visitLabel(new Label());
                mv.visitVarInsn(Opcodes.ALOAD, 0);
                mv.visitVarInsn(Opcodes.ALOAD, 1);
View Full Code Here

                mv.visitInsn(Opcodes.RETURN);
                mv.visitLabel(new Label());
                mv.visitMaxs(2, 3);
                mv.visitEnd();

                mv = cw.visitMethod(Opcodes.ACC_PUBLIC, "getFaultInfo",
                                    "()" + beanClassCode, null, null);
                mv.visitCode();
                mv.visitLabel(new Label());
                mv.visitVarInsn(Opcodes.ALOAD, 0);
                mv.visitFieldInsn(Opcodes.GETFIELD, newClassName, "faultInfo", beanClassCode);
View Full Code Here

                String beanClassCode = getClassCode(bean);
                fv = cw.visitField(0, "faultInfo", beanClassCode, null, null);
                fv.visitEnd();
                               
               
                mv = cw.visitMethod(Opcodes.ACC_PUBLIC, "<init>",
                                    "(Ljava/lang/String;" + beanClassCode + ")V", null, null);
                mv.visitCode();
                mv.visitLabel(new Label());
                mv.visitVarInsn(Opcodes.ALOAD, 0);
                mv.visitVarInsn(Opcodes.ALOAD, 1);
View Full Code Here

                mv.visitInsn(Opcodes.RETURN);
                mv.visitLabel(new Label());
                mv.visitMaxs(2, 3);
                mv.visitEnd();

                mv = cw.visitMethod(Opcodes.ACC_PUBLIC, "getFaultInfo",
                                    "()" + beanClassCode, null, null);
                mv.visitCode();
                mv.visitLabel(new Label());
                mv.visitVarInsn(Opcodes.ALOAD, 0);
                mv.visitFieldInsn(Opcodes.GETFIELD, newClassName, "faultInfo", beanClassCode);
View Full Code Here

            av0.visit("name", "");           
        }
        av0.visitEnd();

        // add constructor
        MethodVisitor mv = cw.visitMethod(Opcodes.ACC_PUBLIC, "<init>", "()V", null, null);
        mv.visitCode();
        Label lbegin = new Label();
        mv.visitLabel(lbegin);
        mv.visitVarInsn(Opcodes.ALOAD, 0);
        mv.visitMethodInsn(Opcodes.INVOKESPECIAL, "java/lang/Object", "<init>", "()V");
View Full Code Here

            av0.visit("name", "");           
        }
        av0.visitEnd();

        // add constructor
        MethodVisitor mv = cw.visitMethod(Opcodes.ACC_PUBLIC, "<init>", "()V", null, null);
        mv.visitCode();
        Label lbegin = new Label();
        mv.visitLabel(lbegin);
        mv.visitVarInsn(Opcodes.ALOAD, 0);
        mv.visitMethodInsn(Opcodes.INVOKESPECIAL, "java/lang/Object", "<init>", "()V");
View Full Code Here

    MethodVisitor mw;
    String name = "test";
    cw.visit(V1_5, ACC_PUBLIC, name, null, "java/lang/Object",
        new String[] { IParser.NAME });

    mw = cw.visitMethod(ACC_PUBLIC, "<init>", "()V", null, null);
    mw.visitVarInsn(ALOAD, THIS);
    mw.visitMethodInsn(INVOKESPECIAL, "java/lang/Object", "<init>", "()V");
    mw.visitInsn(RETURN);
    mw.visitMaxs(0, 0);
    mw.visitEnd();
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.