Package org.objectweb.asm

Examples of org.objectweb.asm.CodeVisitor


       
        if ((access & Constants.ACC_ABSTRACT) == 0 //non abastract method
                && (visitConstructor || !"<init>".equals(name)) // permit to forget constructors
                ) {
                logger.log(BasicLevel.DEBUG, "\t\tVisit the method: " + name + desc);
                CodeVisitor mv = super.cv.visitMethod(access, name, desc, exceptions, attrs);
                mv = new CodeRenamer(mv, gc.firstClass, gc.classToWrite);
                mv = new CodeRenamer(mv, gc.secondClass, gc.classToWrite);
            return mv;
        } else {
            return null;
View Full Code Here


                final String name,
                final String supername,
                final String[] interfaces,
                final String sourceFile) {
            super.cv.visit(version, access, name, supername, interfaces, sourceFile);
            CodeVisitor mv = cv.visitMethod(Constants.ACC_PUBLIC, "<init>", "()V", null, null);
            mv.visitVarInsn(Constants.ALOAD, 0);
            mv.visitMethodInsn(Constants.INVOKESPECIAL, gc.getSuperName(), "<init>", "()V");
            mv.visitInsn(Constants.RETURN);
            mv.visitMaxs(1, 1);
        }
View Full Code Here

                final String name,
                final String supername,
                final String[] interfaces,
                final String sourceFile) {
            super.cv.visit(version, access, name, supername, interfaces, sourceFile);
            CodeVisitor mv = cv.visitMethod(Constants.ACC_PUBLIC, "<init>", "()V", null, null);
            mv.visitVarInsn(Constants.ALOAD, 0);
            mv.visitMethodInsn(Constants.INVOKESPECIAL, gc.getSuperName(), "<init>", "()V");
            mv.visitInsn(Constants.RETURN);
            mv.visitMaxs(1, 1);
        }
View Full Code Here

        mv.visitLabel(l2);
        mv.visitInsn(ARETURN);
        mv.visitMaxs(0, 0);
    }
    private void generateJdoReplaceFlagsMethod() {
        CodeVisitor mv = cv.visitMethod(ACC_PUBLIC, "jdoReplaceFlags",
                "()V", null, null);
        generateThrowJDOUnsupportedOptionException(mv);
        mv.visitMaxs(0, 0);
    }   
View Full Code Here

                "()V", null, null);
        generateThrowJDOUnsupportedOptionException(mv);
        mv.visitMaxs(0, 0);
    }   
    private void generateJdoNewInstanceSMMethod() {
        CodeVisitor mv = cv.visitMethod(ACC_PUBLIC, "jdoNewInstance",
                "(Ljavax/jdo/spi/StateManager;)" +
                "Ljavax/jdo/spi/PersistenceCapable;", null, null);
        generateThrowJDOUnsupportedOptionException(mv);
        mv.visitMaxs(0, 0);
    }
View Full Code Here

                "Ljavax/jdo/spi/PersistenceCapable;", null, null);
        generateThrowJDOUnsupportedOptionException(mv);
        mv.visitMaxs(0, 0);
    }
    private void generateJdoNewInstanceSMOMethod() {
        CodeVisitor mv = cv.visitMethod(ACC_PUBLIC, "jdoNewInstance",
                "(Ljavax/jdo/spi/StateManager;Ljava/lang/Object;)"
                + "Ljavax/jdo/spi/PersistenceCapable;", null, null);
        generateThrowJDOUnsupportedOptionException(mv);
        mv.visitMaxs(0, 0);
    }
View Full Code Here

                + "Ljavax/jdo/spi/PersistenceCapable;", null, null);
        generateThrowJDOUnsupportedOptionException(mv);
        mv.visitMaxs(0, 0);
    }
    private void generateJdoNewObjectIdInstanceMethod() {
        CodeVisitor mv = cv.visitMethod(ACC_PUBLIC, "jdoNewObjectIdInstance",
                "()Ljava/lang/Object;", null, null);
        generateThrowJDOUnsupportedOptionException(mv);
        mv.visitMaxs(0, 0);
    }
View Full Code Here

                "()Ljava/lang/Object;", null, null);
        generateThrowJDOUnsupportedOptionException(mv);
        mv.visitMaxs(0, 0);
    }
    private void generateJdoGetObjectIdMethod() {
        CodeVisitor mv = cv.visitMethod(ACC_PUBLIC, "jdoGetObjectId",
                "()Ljava/lang/Object;", null, null);
        mv.visitVarInsn(ALOAD, 0);
        mv.visitMethodInsn(INVOKEVIRTUAL, classToWrite,
                "getPName", "()Lorg/objectweb/jorm/naming/api/PName;");
        mv.visitInsn(ARETURN);
        mv.visitMaxs(0, 0);
    }
View Full Code Here

                "getPName", "()Lorg/objectweb/jorm/naming/api/PName;");
        mv.visitInsn(ARETURN);
        mv.visitMaxs(0, 0);
    }
    private void generateJdoGetTransactionalObjectIdMethod() {
        CodeVisitor mv = cv.visitMethod(ACC_PUBLIC, "jdoGetTransactionalObjectId",
                "()Ljava/lang/Object;", null, null);
        mv.visitVarInsn(ALOAD, 0);
        mv.visitMethodInsn(INVOKEVIRTUAL, classToWrite, "getPName",
                "()Lorg/objectweb/jorm/naming/api/PName;");
        mv.visitInsn(ARETURN);
        mv.visitMaxs(0, 0);
    }   
View Full Code Here

                "()Lorg/objectweb/jorm/naming/api/PName;");
        mv.visitInsn(ARETURN);
        mv.visitMaxs(0, 0);
    }   
    private void generateJdoReplaceFieldIMethod() {
        CodeVisitor mv;
        mv = cv.visitMethod(ACC_PUBLIC, "jdoReplaceField", "(I)V", null, null);
        generateThrowJDOUnsupportedOptionException(mv);
        mv.visitMaxs(0, 0);
    }
View Full Code Here

TOP

Related Classes of org.objectweb.asm.CodeVisitor

Copyright © 2018 www.massapicom. 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.