Package br.com.caelum.vraptor.asm

Examples of br.com.caelum.vraptor.asm.AnnotationVisitor


    public void visitEnum(final String name, final String desc, final String value) {
        av.visitEnum(name, renamer.mapType(desc), value);
    }

    public AnnotationVisitor visitAnnotation(final String name, final String desc) {
        AnnotationVisitor v = av.visitAnnotation(name, renamer.mapType(desc));
        return v == null ? null : (v == av ? this : new RemappingAnnotationAdapter(v, renamer));
    }


        AnnotationVisitor v = av.visitAnnotation(name, renamer.mapType(desc));
        return v == null ? null : (v == av ? this : new RemappingAnnotationAdapter(v, renamer));
    }

    public AnnotationVisitor visitArray(final String name) {
        AnnotationVisitor v = av.visitArray(name);
        return v == null ? null : (v == av ? this : new RemappingAnnotationAdapter(v, renamer));
    }

                remapper.mapType(superName), interfaces == null ? null : remapper.mapTypes(interfaces));
    }

    @Override
    public AnnotationVisitor visitAnnotation(final String desc, final boolean visible) {
        AnnotationVisitor av;
        av = super.visitAnnotation(remapper.mapType(desc), visible);
        return av == null ? null : createRemappingAnnotationAdapter(av);
    }

        super.visitLocalVariable(name, remapper.mapDesc(desc), remapper.mapSignature(signature, true), start, end,
                index);
    }

    public AnnotationVisitor visitAnnotation(final String desc, final boolean visible) {
        AnnotationVisitor av = mv.visitAnnotation(desc, visible);
        return av == null ? av : new RemappingAnnotationAdapter(av, remapper);
    }

        AnnotationVisitor av = mv.visitAnnotation(desc, visible);
        return av == null ? av : new RemappingAnnotationAdapter(av, remapper);
    }

    public AnnotationVisitor visitAnnotationDefault() {
        AnnotationVisitor av = mv.visitAnnotationDefault();
        return av == null ? av : new RemappingAnnotationAdapter(av, remapper);
    }

        AnnotationVisitor av = mv.visitAnnotationDefault();
        return av == null ? av : new RemappingAnnotationAdapter(av, remapper);
    }

    public AnnotationVisitor visitParameterAnnotation(final int parameter, final String desc, final boolean visible) {
        AnnotationVisitor av = mv.visitParameterAnnotation(parameter, desc, visible);
        return av == null ? av : new RemappingAnnotationAdapter(av, remapper);
    }

        this.fv = fv;
        this.remapper = remapper;
    }

    public AnnotationVisitor visitAnnotation(final String desc, final boolean visible) {
        AnnotationVisitor av = fv.visitAnnotation(desc, visible);
        return av == null ? null : new RemappingAnnotationAdapter(av, remapper);
    }

    }

    public void visit(final String name, final Object value) {
        Class c = value.getClass();
        if (c.isArray()) {
            AnnotationVisitor av = visitArray(name);
            if (value instanceof byte[]) {
                byte[] b = (byte[]) value;
                for (int i = 0; i < b.length; i++) {
                    av.visit(null, new Byte(b[i]));
                }

            } else if (value instanceof char[]) {
                char[] b = (char[]) value;
                for (int i = 0; i < b.length; i++) {
                    av.visit(null, new Character(b[i]));
                }

            } else if (value instanceof short[]) {
                short[] b = (short[]) value;
                for (int i = 0; i < b.length; i++) {
                    av.visit(null, new Short(b[i]));
                }

            } else if (value instanceof boolean[]) {
                boolean[] b = (boolean[]) value;
                for (int i = 0; i < b.length; i++) {
                    av.visit(null, Boolean.valueOf(b[i]));
                }

            } else if (value instanceof int[]) {
                int[] b = (int[]) value;
                for (int i = 0; i < b.length; i++) {
                    av.visit(null, new Integer(b[i]));
                }

            } else if (value instanceof long[]) {
                long[] b = (long[]) value;
                for (int i = 0; i < b.length; i++) {
                    av.visit(null, new Long(b[i]));
                }

            } else if (value instanceof float[]) {
                float[] b = (float[]) value;
                for (int i = 0; i < b.length; i++) {
                    av.visit(null, new Float(b[i]));
                }

            } else if (value instanceof double[]) {
                double[] b = (double[]) value;
                for (int i = 0; i < b.length; i++) {
                    av.visit(null, new Double(b[i]));
                }

            }
            av.visitEnd();
        } else {
            addValueElement("annotationValue", name, Type.getDescriptor(c), value.toString());
        }
    }

            }
        }

        @Override
        public void end(final String name) {
            AnnotationVisitor av = (AnnotationVisitor) pop();
            if (av != null) {
                av.visitEnd();
            }
        }

            push(((MethodVisitor) peek()).visitParameterAnnotation(parameter, desc, visible));
        }

        @Override
        public void end(final String name) {
            AnnotationVisitor av = (AnnotationVisitor) pop();
            if (av != null) {
                av.visitEnd();
            }
        }

TOP

Related Classes of br.com.caelum.vraptor.asm.AnnotationVisitor

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.