private static List < Map < String , Object > > getEntityAnnos ( Object targetClass , String annotationName ) { Annotation [ ] anno = null ; if ( targetClass instanceof Field ) anno = ( ( Field ) targetClass ) . getAnnotations ( ) ; else anno = ( ( Class < ? > ) targetClass ) . getAnnotations ( ) ; List < Map < String , Object > > l = new ArrayList < Map < String , Object > > ( ) ; for ( Annotation annotation : anno ) { Class < ? extends Annotation > type = annotation . annotationType ( ) ; String cName = type . getName ( ) ; if ( matchNameCheck ( annotationName , cName ) ) { l . add ( changeAnnotationValuesToMap ( annotation , type ) ) ; } } return l ; }
Get all entity annotations started with annotationName