Package org.apache.tapestry5.internal.plastic.asm

Examples of org.apache.tapestry5.internal.plastic.asm.MethodVisitor.visitCode()


    public void visitEnd() {
        if (syntheticClassFields.isEmpty()) {
            if (hasClinitMethod) {
                MethodVisitor mv = cv.visitMethod(Opcodes.ACC_STATIC
                        | Opcodes.ACC_SYNTHETIC, "_clinit_", "()V", null, null);
                mv.visitCode();
                mv.visitInsn(Opcodes.RETURN);
                mv.visitMaxs(0, 0);
                mv.visitEnd();
            }
        } else {
View Full Code Here


            }
        } else {
            MethodVisitor mv = cv.visitMethod(Opcodes.ACC_STATIC
                    | Opcodes.ACC_SYNTHETIC, "class$",
                    "(Ljava/lang/String;)Ljava/lang/Class;", null, null);
            mv.visitCode();
            Label l0 = new Label();
            Label l1 = new Label();
            Label l2 = new Label();
            mv.visitTryCatchBlock(l0, l1, l2,
                    "java/lang/ClassNotFoundException");
View Full Code Here

    public void implementPublicConstructor(ClassWriter cw, String superClassName)
    {

        MethodVisitor mv = cw.visitMethod(ACC_PUBLIC, "<init>", "()V", null, null);
        mv.visitCode();
        mv.visitVarInsn(ALOAD, 0);
        mv.visitMethodInsn(INVOKESPECIAL, PlasticInternalUtils.toInternalName(superClassName), "<init>", "()V");
        mv.visitInsn(RETURN);
        mv.visitEnd();
    }
View Full Code Here

        ClassWriter cw = helper.createWriter(SYNTH_COMPONENT_CLASSNAME, BASIC_COMPONENT_CLASSNAME, Named.class.getName());

        helper.implementPublicConstructor(cw, BASIC_COMPONENT_CLASSNAME);

        MethodVisitor mv = cw.visitMethod(ACC_PUBLIC, "getName", "()Ljava/lang/String;", null, null);
        mv.visitCode();
        mv.visitLdcInsn(name);
        mv.visitInsn(ARETURN);
        mv.visitEnd();

        cw.visitEnd();
View Full Code Here

        String className = PACKAGE + ".Index";

        ClassWriter cw = helper.createWriter(className, "java.lang.Object");

        MethodVisitor mv = cw.visitMethod(ACC_PUBLIC, "getNumber", "()I", null, null);
        mv.visitCode();
        mv.visitLdcInsn(number);
        mv.visitInsn(IRETURN);
        cw.visitEnd();

        cw.visitEnd();
View Full Code Here

        ClassWriter cw = createClassWriter(internalName, baseClassInternalName, ACC_PUBLIC);

        // Add default constructor

        MethodVisitor mv = cw.visitMethod(ACC_PUBLIC, "<init>", "()V", null, null);
        mv.visitCode();
        mv.visitVarInsn(ALOAD, 0);
        mv.visitMethodInsn(INVOKESPECIAL, baseClassInternalName, "<init>", "()V");
        mv.visitInsn(RETURN);
        mv.visitMaxs(1, 1);
        mv.visitEnd();
View Full Code Here

        ClassWriter cw = createClassWriter(internalName, "java/lang/Object", ACC_PUBLIC);

        // Add default constructor

        MethodVisitor mv = cw.visitMethod(ACC_PUBLIC, "<init>", "()V", null, null);
        mv.visitCode();
        mv.visitVarInsn(ALOAD, 0);
        mv.visitMethodInsn(INVOKESPECIAL, "java/lang/Object", "<init>", "()V");
        mv.visitInsn(RETURN);
        mv.visitMaxs(1, 1);
        mv.visitEnd();
View Full Code Here

        mv.visitMaxs(1, 1);
        mv.visitEnd();


        mv = cw.visitMethod(ACC_PUBLIC, "getStatus", "()Ljava/lang/String;", null, null);
        mv.visitCode();
        mv.visitLdcInsn(status);
        mv.visitInsn(ARETURN);
        mv.visitMaxs(1, 1);
        mv.visitEnd();
View Full Code Here

        ClassWriter cw = helper.createWriter(SYNTH_COMPONENT_CLASSNAME, BASIC_COMPONENT_CLASSNAME, Named.class.getName());

        helper.implementPublicConstructor(cw, BASIC_COMPONENT_CLASSNAME);

        MethodVisitor mv = cw.visitMethod(ACC_PUBLIC, "getName", "()Ljava/lang/String;", null, null);
        mv.visitCode();
        mv.visitLdcInsn(name);
        mv.visitInsn(ARETURN);
        mv.visitEnd();

        cw.visitEnd();
View Full Code Here

        cw.visit(V1_5, ACC_PUBLIC, "EnhancedSyntheticMethodModule", null,
                PlasticInternalUtils.toInternalName(SyntheticMethodModule.class.getName()), null);

        MethodVisitor mv = cw.visitMethod(ACC_PUBLIC | ACC_STATIC | ACC_SYNTHETIC, "synth", "()V", null, null);
        mv.visitCode();
        mv.visitInsn(RETURN);
        mv.visitEnd();

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