mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
Merge pull request #2469 from FOCONIS/pr/enh/helper_methods_annotation_util
Add metaHas and metaFindAll in AnnotationUtil
This commit is contained in:
@@ -71,6 +71,20 @@ public class AnnotationUtil {
|
||||
return typeGet(clazz, annotation) != null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if an element is annotated with an annotation of given type searching meta-annotations.
|
||||
*/
|
||||
public static boolean metaHas(AnnotatedElement element, Class<?> annotationType) {
|
||||
return !metaFindAll(element, annotationType).isEmpty();
|
||||
}
|
||||
|
||||
/**
|
||||
* Find all the annotations of a given type searching meta-annotations.
|
||||
*/
|
||||
public static Set<Annotation> metaFindAll(AnnotatedElement element, Class<?> annotationType) {
|
||||
return metaFindAllFor(element, Collections.singleton(annotationType));
|
||||
}
|
||||
|
||||
/**
|
||||
* Find all the annotations for the filter searching meta-annotations.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user