Examples of visitTypeInsn()


Examples of org.apache.xbean.asm4.MethodVisitor.visitTypeInsn()

            // invoke the get() method on the Provider
            mv.visitMethodInsn(Opcodes.INVOKEINTERFACE, Type.getInternalName(Provider.class), "get", "()Ljava/lang/Object;");

            // and convert the Object to the target class type
            mv.visitTypeInsn(Opcodes.CHECKCAST, Type.getInternalName(classToProxy));


            // now calculate the parameters
            int offset = 1;
            for (Class<?> aClass : delegatedMethod.getParameterTypes())
View Full Code Here

Examples of org.apache.xbean.asm5.MethodVisitor.visitTypeInsn()

        // invoke the invocationHandler
        mv.visitMethodInsn(INVOKEINTERFACE, "java/lang/reflect/InvocationHandler", "invoke", "(Ljava/lang/Object;Ljava/lang/reflect/Method;[Ljava/lang/Object;)Ljava/lang/Object;", true);

        // cast the result
        mv.visitTypeInsn(CHECKCAST, getCastType(returnType));

        if (returnType.isPrimitive() && !Void.TYPE.equals(returnType)) {
            // get the primitive value
            mv.visitMethodInsn(INVOKEVIRTUAL, getWrapperType(returnType), getPrimitiveMethod(returnType), "()" + getPrimitiveLetter(returnType), false);
        }
View Full Code Here

Examples of org.codehaus.aspectwerkz.org.objectweb.asm.CodeVisitor.visitTypeInsn()

                    GET_STATIC_PART_METHOD_NAME,
                    GET_STATIC_PART_METHOD_SIGNATURE,
                    null, null
            );
            cv.visitFieldInsn(GETSTATIC, className, SIGNATURE_FIELD_NAME, METHOD_SIGNATURE_IMPL_CLASS_SIGNATURE);
            cv.visitTypeInsn(CHECKCAST, METHOD_SIGNATURE_IMPL_CLASS_NAME);
            cv.visitMethodInsn(
                    INVOKEVIRTUAL, METHOD_SIGNATURE_IMPL_CLASS_NAME, GET_METHOD_METHOD_NAME,
                    GET_METHOD_METHOD_SIGNATURE
            );
            cv.visitInsn(ARETURN);
View Full Code Here

Examples of org.codehaus.jackson.org.objectweb.asm.MethodVisitor.visitTypeInsn()

    {
        MethodVisitor mv = cw.visitMethod(ACC_PUBLIC, "intGetter", "(Ljava/lang/Object;I)I", /*generic sig*/null, null);
        mv.visitCode();
        // first: cast bean to proper type
        mv.visitVarInsn(ALOAD, 1);
        mv.visitTypeInsn(CHECKCAST, beanClass);
        mv.visitVarInsn(ASTORE, 3);

        // Ok; minor optimization, 4 or less accessors, just do IFs; over that, use switch
        if (props.size() <= 4) {
            _addGettersUsingIf(mv, props, beanClass, IRETURN, ALL_INT_CONSTS);
View Full Code Here

Examples of org.deuce.objectweb.asm.MethodVisitor.visitTypeInsn()

      mv.visitMethodInsn(INVOKESPECIAL, Names.UniCastObject, "<init>", "()V");
      Label l7 = new Label();
      mv.visitLabel(l7);
 
      mv.visitMethodInsn(INVOKESTATIC, Names.Hyflow, "getLocator", Type.getMethodDescriptor(Type.getType(DirectoryManager.class), new Type [] {})); //"()Laleph/dir/DirectoryManager;");
      mv.visitTypeInsn(CHECKCAST, Names.ControlFlowDirectory);
      mv.visitVarInsn(ALOAD, 0);
      mv.visitMethodInsn(INVOKEVIRTUAL, Names.ControlFlowDirectory, "addProxy", Type.getMethodDescriptor(Type.VOID_TYPE, new Type[] {Type.getType(Object.class)})); //"(Ljava/lang/Object;)V");
      Label l8 = new Label();
      mv.visitLabel(l8);
 
View Full Code Here

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

            // final <classname> other = (<classname>) obj;
            mv.visitLabel( l3 );
            mv.visitVarInsn( Opcodes.ALOAD,
                             1 );
            mv.visitTypeInsn( Opcodes.CHECKCAST,
                              getInternalType( classDef.getClassName() ) );
            mv.visitVarInsn( Opcodes.ASTORE,
                             2 );

            // for each key field
View Full Code Here

Examples of org.eclipse.persistence.internal.libraries.asm.CodeVisitor.visitTypeInsn()

            cv = cw.visitMethod(ACC_PUBLIC, "<init>", "()V", null, null);
            cv.visitVarInsn(ALOAD, 0);
            cv.visitMethodInsn(INVOKESPECIAL, BASE_ENTITY_CLASSNAME_SLASHES, "<init>", "()V");
            cv.visitVarInsn(ALOAD, 0);
            cv.visitMethodInsn(INVOKESTATIC, classNameAsSlashes, "getNumAttributes", "()I");
            cv.visitTypeInsn(ANEWARRAY, "java/lang/Object");
            cv.visitFieldInsn(PUTFIELD, classNameAsSlashes, "fields", "[Ljava/lang/Object;");
            cv.visitInsn(RETURN);
            cv.visitMaxs(0, 0);
        }
        cw.visitEnd();
View Full Code Here

Examples of org.eclipse.persistence.internal.libraries.asm.MethodVisitor.visitTypeInsn()

        mv.visitEnd();

        mv = cw.visitMethod(Opcodes.ACC_PUBLIC + Opcodes.ACC_BRIDGE + Opcodes.ACC_SYNTHETIC, "setItem", "(Ljava/lang/Object;)V", null, null);
        mv.visitVarInsn(Opcodes.ALOAD, 0);
        mv.visitVarInsn(Opcodes.ALOAD, 1);
        mv.visitTypeInsn(Opcodes.CHECKCAST, mapType.getInternalName());
        mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, qualifiedInternalClassName, "setItem", "(L" + mapType.getInternalName() + ";)V");
        mv.visitInsn(Opcodes.RETURN);
        mv.visitMaxs(2, 2);
        mv.visitEnd();
View Full Code Here

Examples of org.glassfish.hk2.external.org.objectweb.asm.MethodVisitor.visitTypeInsn()

            mv.visitLabel(l2);
            mv.visitMethodInsn(INVOKEVIRTUAL,
                    "java/lang/ClassNotFoundException", "getMessage",
                    "()Ljava/lang/String;");
            mv.visitVarInsn(ASTORE, 1);
            mv.visitTypeInsn(NEW, "java/lang/NoClassDefFoundError");
            mv.visitInsn(DUP);
            mv.visitVarInsn(ALOAD, 1);
            mv.visitMethodInsn(INVOKESPECIAL, "java/lang/NoClassDefFoundError",
                    "<init>", "(Ljava/lang/String;)V");
            mv.visitInsn(ATHROW);
View Full Code Here

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

    protected void buildCommonMethods( ClassWriter cw, String proxy ) {
        MethodVisitor mv;
        {
            mv = cw.visitMethod( ACC_PUBLIC, "toString", "()" + Type.getDescriptor( String.class ), null, null );
            mv.visitCode();
            mv.visitTypeInsn( NEW, Type.getInternalName( StringBuilder.class ) );
            mv.visitInsn( DUP );
            mv.visitMethodInsn( INVOKESPECIAL, Type.getInternalName( StringBuilder.class ), "<init>", "()V" );
            mv.visitLdcInsn( "(@" + proxy + ") : " );
            mv.visitMethodInsn( INVOKEVIRTUAL, Type.getInternalName( StringBuilder.class ), "append", "(" + Type.getDescriptor( String.class ) + ")" + Type.getDescriptor( StringBuilder.class ) );
            mv.visitVarInsn( ALOAD, 0 );
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.