/** * Makes the given visitor visit this annotation. * * @param av an annotation visitor. */ public void accept(final AnnotationVisitor av) { if (this.values != null) { for (int i = 0; i < this.values.size(); i += 2) { final String name = (String) this.values.get(i); final Object value = this.values.get(i + 1); accept(av, name, value); } } av.visitEnd(); }
/** * Makes the given visitor visit a given annotation value. * * @param av an annotation visitor. * @param name the value name. * @param value the actual value. */ static void accept(final AnnotationVisitor av, final String name, final Object value) { if (value instanceof String[]) { final String[] typeconst = (String[]) value; av.visitEnum(name, typeconst[0], typeconst[1]); } else if (value instanceof AnnotationNode) { final AnnotationNode an = (AnnotationNode) value; an.accept(av.visitAnnotation(name, an.desc)); } else if (value instanceof List) { final AnnotationVisitor v = av.visitArray(name); final List array = (List) value; for (int j = 0; j < array.size(); ++j) { accept(v, null, array.get(j)); } v.visitEnd(); } else { av.visit(name, value); } }