public static Annotation [ ] getResourcesAnnotations ( Method method ) { Map < Class < ? > , Annotation > annotations = new HashMap < Class < ? > , Annotation > ( ) ; for ( Annotation annotation : method . getDeclaringClass ( ) . getAnnotations ( ) ) { annotations . put ( annotation . getClass ( ) , annotation ) ; } for ( Annotation annotation : method . getAnnotations ( ) ) { annotations . put ( annotation . getClass ( ) , annotation ) ; } return annotations . values ( ) . toArray ( new Annotation [ annotations . size ( ) ] ) ; }
Returns an array of annotations the specified method of a resource class .