public static void visitAnnotationFields(AnnotationVisitor visitor, Map<String, Object> fields) {
for (Map.Entry<String, Object> fieldEntry : fields.entrySet()) {
Object value = fieldEntry.getValue();
if (value.getClass().isArray()) {
Object[] values = (Object[]) value;
AnnotationVisitor arrayV = visitor.visitArray(fieldEntry.getKey());
for (int i = 0; i < values.length; i++) {
arrayV.visit(null, values[i]);
}
arrayV.visitEnd();
} else if (value.getClass().isEnum()) {
visitor.visitEnum(fieldEntry.getKey(), ci(value.getClass()), value.toString());
} else if (value instanceof Class) {
visitor.visit(fieldEntry.getKey(), Type.getType((Class)value));
} else {