Package org.codehaus.jackson.org.objectweb.asm

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


        mv.visitCode();
        mv.visitVarInsn(ALOAD, 0);
        mv.visitMethodInsn(INVOKESPECIAL, superClass, "<init>", "()V");
        mv.visitInsn(RETURN);
        mv.visitMaxs(0, 0); // don't care (real values: 1,1)
        mv.visitEnd();
       
        final String beanClass = internalClassName(beanType.getName());
        // and then add various accessors; first field accessors:
        if (!_intFields.isEmpty()) {
View Full Code Here


            _addGettersUsingSwitch(mv, props, beanClass, IRETURN);
        }
        // and if no match, generate exception:
        generateException(mv, beanClass, props.size());
        mv.visitMaxs(0, 0); // don't care (real values: 1,1)
        mv.visitEnd();
    }

    private static void _addLongGetters(ClassWriter cw, List<LongMethodPropertyWriter> props,
            String beanClass)
    {
View Full Code Here

        // and if no match, generate exception:
        generateException(mv, beanClass, props.size());

        // and that's it
        mv.visitMaxs(0, 0); // don't care (real values: 1,1)
        mv.visitEnd();
    }

    private static void _addStringGetters(ClassWriter cw, List<StringMethodPropertyWriter> props,
            String beanClass)
    {
View Full Code Here

        } else {
            _addGettersUsingSwitch(mv, props, beanClass, ARETURN);
        }
        generateException(mv, beanClass, props.size());
        mv.visitMaxs(0, 0);
        mv.visitEnd();
    }

    private static void _addObjectGetters(ClassWriter cw, List<ObjectMethodPropertyWriter> props,
            String beanClass)
    {
View Full Code Here

            mv.visitCode();
            mv.visitVarInsn(ALOAD, 0);
            mv.visitMethodInsn(INVOKESPECIAL, superClass, "<init>", "()V");
            mv.visitInsn(RETURN);
            mv.visitMaxs(0, 0);
            mv.visitEnd();
            // then single-arg constructor
            mv = cw.visitMethod(ACC_PUBLIC, "<init>", "("+stdValueInstDesc+")V", null, null);
            mv.visitCode();
            mv.visitVarInsn(ALOAD, 0);
            mv.visitVarInsn(ALOAD, 1);
View Full Code Here

        } else {
            _addGettersUsingSwitch(mv, props, beanClass, ARETURN);
        }
        generateException(mv, beanClass, props.size());
        mv.visitMaxs(0, 0);
        mv.visitEnd();
    }
   
    /*
    /**********************************************************
    /* Code generation; field-based getters
View Full Code Here

            mv.visitVarInsn(ALOAD, 0);
            mv.visitVarInsn(ALOAD, 1);
            mv.visitMethodInsn(INVOKESPECIAL, superClass, "<init>", "("+stdValueInstDesc+")V");
            mv.visitInsn(RETURN);
            mv.visitMaxs(0, 0);
            mv.visitEnd();

            // and then non-static factory method to use second constructor (implements base-class method)
            // protected abstract OptimizedValueInstantiator with(StdValueInstantiator src);
            mv = cw.visitMethod(ACC_PUBLIC, "with", "("
                    +stdValueInstDesc+")"+optimizedValueInstDesc, null, null);
View Full Code Here

            _addFieldsUsingSwitch(mv, props, beanClass, IRETURN, "I");
        }
        // and if no match, generate exception:
        generateException(mv, beanClass, props.size());
        mv.visitMaxs(0, 0); // don't care (real values: 1,1)
        mv.visitEnd();
    }

    private static void _addLongFields(ClassWriter cw, List<LongFieldPropertyWriter> props,
            String beanClass)
    {
View Full Code Here

            mv.visitInsn(DUP);
            mv.visitVarInsn(ALOAD, 1);
            mv.visitMethodInsn(INVOKESPECIAL, generatedClass, "<init>", "("+stdValueInstDesc+")V");
            mv.visitInsn(ARETURN);
            mv.visitMaxs(0, 0);
            mv.visitEnd();

            // And then override: public Object createUsingDefault()
            mv = cw.visitMethod(ACC_PUBLIC, "createUsingDefault", "()Ljava/lang/Object;", null, null);
            mv.visitCode();
           
View Full Code Here

            _addFieldsUsingSwitch(mv, props, beanClass, LRETURN, "J");
        }
        // and if no match, generate exception:
        generateException(mv, beanClass, props.size());
        mv.visitMaxs(0, 0); // don't care (real values: 1,1)
        mv.visitEnd();
    }

    private static void _addStringFields(ClassWriter cw, List<StringFieldPropertyWriter> props,
            String beanClass)
    {
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.