Package com.alibaba.citrus.asm

Examples of com.alibaba.citrus.asm.AnnotationVisitor


            MethodVisitor av = (MethodVisitor) peek();
            push(av == null ? null : av.visitAnnotationDefault());
        }

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


     */
    protected FieldVisitor fv;

    @Override
    public AnnotationVisitor visitAnnotation(final String desc, final boolean visible) {
        AnnotationVisitor av = super.visitAnnotation(desc, visible);
        if (fv != null) {
            ((TraceAnnotationVisitor) av).av = fv.visitAnnotation(desc, visible);
        }
        return av;
    }

    }

    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 (byte element : b) {
                    av.visit(null, new Byte(element));
                }

            } else if (value instanceof char[]) {
                char[] b = (char[]) value;
                for (char element : b) {
                    av.visit(null, new Character(element));
                }

            } else if (value instanceof short[]) {
                short[] b = (short[]) value;
                for (short element : b) {
                    av.visit(null, new Short(element));
                }

            } else if (value instanceof boolean[]) {
                boolean[] b = (boolean[]) value;
                for (boolean element : b) {
                    av.visit(null, Boolean.valueOf(element));
                }

            } else if (value instanceof int[]) {
                int[] b = (int[]) value;
                for (int element : b) {
                    av.visit(null, new Integer(element));
                }

            } else if (value instanceof long[]) {
                long[] b = (long[]) value;
                for (long element : b) {
                    av.visit(null, new Long(element));
                }

            } else if (value instanceof float[]) {
                float[] b = (float[]) value;
                for (float element : b) {
                    av.visit(null, new Float(element));
                }

            } else if (value instanceof double[]) {
                double[] b = (double[]) value;
                for (double element : b) {
                    av.visit(null, new Double(element));
                }

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

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

    public AnnotationVisitor visitAnnotation(String name, 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(String name) {
        AnnotationVisitor v = av.visitArray(name);
        return v == null ? null : v == av ? this : new RemappingAnnotationAdapter(v, renamer);
    }

    // Implementation of the MethodVisitor interface
    // ------------------------------------------------------------------------

    @Override
    public AnnotationVisitor visitAnnotation(final String desc, final boolean visible) {
        AnnotationVisitor av = super.visitAnnotation(desc, visible);
        if (mv != null) {
            ((TraceAnnotationVisitor) av).av = mv.visitAnnotation(desc, visible);
        }
        return av;
    }

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

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

                index);
    }

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

        return av == null ? av : new RemappingAnnotationAdapter(av, remapper);
    }

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

        return av == null ? av : new RemappingAnnotationAdapter(av, remapper);
    }

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

TOP

Related Classes of com.alibaba.citrus.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.