Package org.ow2.asm

Examples of org.ow2.asm.MethodVisitor.visitTypeInsn()


        mv.visitMethodInsn(INVOKESPECIAL, "java/lang/Object", "<init>", "()V");

        // Build instance of interceptors
        for (String interceptor : this.allInterceptors) {
            mv.visitVarInsn(ALOAD, 0);
            mv.visitTypeInsn(NEW, interceptor);
            mv.visitInsn(DUP);
            mv.visitMethodInsn(INVOKESPECIAL, interceptor, "<init>", "()V");
            mv.visitFieldInsn(PUTFIELD, this.generatedClassName, getField(interceptor), encodeClassDesc(interceptor));
        }
View Full Code Here


            // put size of the array
            Type[] args = Type.getArgumentTypes(method.getJMethod().getDescriptor());
            int methodArg = 1;

            mv.visitIntInsn(BIPUSH, args.length);
            mv.visitTypeInsn(ANEWARRAY, "java/lang/Object");

            // for each argument of the methods :
            int argCount = 0;
            for (Type type : args) {
                mv.visitInsn(DUP);
View Full Code Here

                mv.visitLabel(catchsLabel[lastCatchBlockLabel]);
                mv.visitVarInsn(ASTORE, methodArg);

                // instanceof RuntimeException
                mv.visitVarInsn(ALOAD, methodArg);
                mv.visitTypeInsn(INSTANCEOF, "java/lang/RuntimeException");
                Label notInstanceOfRuntimeExceptionLabel = new Label();
                mv.visitJumpInsn(IFEQ, notInstanceOfRuntimeExceptionLabel);

                // throw existing runtime exception (by casting it)
                mv.visitVarInsn(ALOAD, methodArg);
View Full Code Here

                Label notInstanceOfRuntimeExceptionLabel = new Label();
                mv.visitJumpInsn(IFEQ, notInstanceOfRuntimeExceptionLabel);

                // throw existing runtime exception (by casting it)
                mv.visitVarInsn(ALOAD, methodArg);
                mv.visitTypeInsn(CHECKCAST, "java/lang/RuntimeException");
                mv.visitInsn(ATHROW);

                // build Runtime exception with given exception
                mv.visitLabel(notInstanceOfRuntimeExceptionLabel);
                mv.visitTypeInsn(NEW, "java/lang/RuntimeException");
View Full Code Here

                mv.visitTypeInsn(CHECKCAST, "java/lang/RuntimeException");
                mv.visitInsn(ATHROW);

                // build Runtime exception with given exception
                mv.visitLabel(notInstanceOfRuntimeExceptionLabel);
                mv.visitTypeInsn(NEW, "java/lang/RuntimeException");
                mv.visitInsn(DUP);
                mv.visitVarInsn(ALOAD, methodArg);
                mv.visitMethodInsn(INVOKESPECIAL, "java/lang/RuntimeException", "<init>", "(Ljava/lang/Throwable;)V");
                mv.visitInsn(ATHROW);
View Full Code Here

        // Start of the Try label of Try/Catch
        Label tryLabel = new Label();
        mv.visitLabel(tryLabel);

        // build new object by calling the constructor
        mv.visitTypeInsn(NEW, genInvCtx.getGeneratedClassName());
        mv.visitInsn(DUP);

        // Add bean (as first argument)
        mv.visitVarInsn(ALOAD, 0);
View Full Code Here

            mv.visitLabel(catchsLabel[lastCatchBlockLabel]);
            mv.visitVarInsn(ASTORE, methodArg);

            // instanceof RuntimeException
            mv.visitVarInsn(ALOAD, methodArg);
            mv.visitTypeInsn(INSTANCEOF, "java/lang/RuntimeException");
            Label notInstanceOfRuntimeExceptionLabel = new Label();
            mv.visitJumpInsn(IFEQ, notInstanceOfRuntimeExceptionLabel);

            // throw existing runtime exception (by casting it)
            mv.visitVarInsn(ALOAD, methodArg);
View Full Code Here

            Label notInstanceOfRuntimeExceptionLabel = new Label();
            mv.visitJumpInsn(IFEQ, notInstanceOfRuntimeExceptionLabel);

            // throw existing runtime exception (by casting it)
            mv.visitVarInsn(ALOAD, methodArg);
            mv.visitTypeInsn(CHECKCAST, "java/lang/RuntimeException");
            mv.visitInsn(ATHROW);

            // build Runtime exception with given exception
            mv.visitLabel(notInstanceOfRuntimeExceptionLabel);
            mv.visitTypeInsn(NEW, "java/lang/RuntimeException");
View Full Code Here

            mv.visitTypeInsn(CHECKCAST, "java/lang/RuntimeException");
            mv.visitInsn(ATHROW);

            // build Runtime exception with given exception
            mv.visitLabel(notInstanceOfRuntimeExceptionLabel);
            mv.visitTypeInsn(NEW, "java/lang/RuntimeException");
            mv.visitInsn(DUP);
            mv.visitVarInsn(ALOAD, methodArg);
            mv.visitMethodInsn(INVOKESPECIAL, "java/lang/RuntimeException", "<init>", "(Ljava/lang/Throwable;)V");
            mv.visitInsn(ATHROW);
View Full Code Here

            mv.visitLdcInsn(this.jMethod.getName());


            // build an array of java.lang.Class with the size of args of the method
            mv.visitIntInsn(BIPUSH, this.methodArgsType.length);
            mv.visitTypeInsn(ANEWARRAY, "java/lang/Class");
            int argCount = 0;
            for (Type type : this.methodArgsType) {
                mv.visitInsn(DUP);
                mv.visitIntInsn(BIPUSH, argCount);
                visitClassType(type, mv);
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.