common_helper/src/main/java/com/xiongyingqi/util/AnnotationHelper.java
public static <T extends Annotation> Collection<T> readAnnotationsInClass(Class<?> clazz, Class<T> annotationClass) {
        Collection<T> collection = null;

        Field[] fields = clazz.getDeclaredFields();
        for (Field field : fields) {
            T t = readAnnotationValueOnField(field, annotationClass);
            if (t == null) {
                continue;
            }

            if (collection == null) {
                collection = new ArrayList<T>();
            }

            collection.add(t);
        }

        return collection;
    }
public static <T extends Annotation> Collection<T> readAnnotationsInClass(Class<?> clazz, Class<T> annotationClass) {
        Collection<T> collection = null;

        Field[] fields = clazz.getDeclaredFields();
        for (Field field : fields) {
            T t = readAnnotationValueOnField(field, annotationClass);
            if (t == null) {
                continue;
            }

            if (collection == null) {
                collection = new ArrayList<T>();
            }

            collection.add(t);
        }

        return collection;
    }
public static < T extends Annotation > Collection < T > readAnnotationsInClass ( Class < ? > clazz , Class < T > annotationClass ) { Collection < T > collection = null ; Field [ ] fields = clazz . getDeclaredFields ( ) ; for ( Field field : fields ) { T t = readAnnotationValueOnField ( field , annotationClass ) ; if ( t == null ) { continue ; } if ( collection == null ) { collection = new ArrayList < T > ( ) ; } collection . add ( t ) ; } return collection ; }
在类内搜索所有的字段的annotationClass注解值

@param clazz
@param annotationClass
@param <T>
@return
在类内搜索所有的字段的annotationClass注解值