public static <T extends Annotation> Set<Field> getAnnotatedFields(Class<? extends Object> clazz,
			Class<T> annotation) {
		if (Object.class.equals(clazz)) {
			return Collections.emptySet();
		}
		Set<Field> annotatedFields = new HashSet<Field>();
		Field[] fields = clazz.getDeclaredFields();
		for (Field field : fields) {
			if (field.getAnnotation(annotation) != null) {
				annotatedFields.add(field);
			}
		}
		annotatedFields.addAll(getAnnotatedFields(clazz.getSuperclass(), annotation));
		return annotatedFields;
	}
public static < T extends Annotation > Set < Field > getAnnotatedFields ( Class < ? extends Object > clazz , Class < T > annotation ) { if ( Object . class . equals ( clazz ) ) { return Collections . emptySet ( ) ; } Set < Field > annotatedFields = new HashSet < Field > ( ) ; Field [ ] fields = clazz . getDeclaredFields ( ) ; for ( Field field : fields ) { if ( field . getAnnotation ( annotation ) != null ) { annotatedFields . add ( field ) ; } } annotatedFields . addAll ( getAnnotatedFields ( clazz . getSuperclass ( ) , annotation ) ) ; return annotatedFields ; }
找出所有标注了该annotation的属性，循环遍历父类，包含private属性.

暂未支持Spring风格Annotation继承Annotation

copy from org.unitils.util.AnnotationUtils