public class AnnotationUtil extends Object
Constructor and Description |
---|
AnnotationUtil() |
Modifier and Type | Method and Description |
---|---|
static <A extends Annotation> |
findAnnotation(AnnotatedElement annotatedElement,
Class<A> annotationType)
|
static <A extends Annotation> |
findAnnotation(AnnotatedElement annotatedElement,
Class<A> annotationType,
io.ebean.annotation.Platform platform)
Finds the first annotation of a type for this platform.
|
static <A extends Annotation> |
findAnnotationRecursive(Class<?> clazz,
Class<A> annotationType)
Find a single
Annotation of annotationType on the supplied class. |
static <A extends Annotation> |
findAnnotations(AnnotatedElement annotatedElement,
Class<A> annotationType)
|
static <A extends Annotation> |
findAnnotationsRecursive(Class<?> clazz,
Class<A> annotationType)
Finds all annotations recusively for a class and its superclasses or interfaces.
|
static <T extends Annotation> |
getPlatformMatchingAnnotation(Set<T> anns,
io.ebean.annotation.Platform matchPlatform)
Finds a suitable annotation from
Set for this platform. |
static boolean |
isInJavaLangAnnotationPackage(Annotation annotation)
Determine if the supplied
Annotation is defined in the core JDK java.lang.annotation package. |
public AnnotationUtil()
public static boolean isInJavaLangAnnotationPackage(Annotation annotation)
Annotation
is defined in the core JDK java.lang.annotation
package.public static <A extends Annotation> A findAnnotation(AnnotatedElement annotatedElement, Class<A> annotationType)
Annotation
of annotationType
on the supplied AnnotatedElement
.
Meta-annotations will be searched if the annotation is not directly present on the supplied element.
Warning: this method operates generically on annotated elements. In other words, this method does not execute specialized search algorithms for classes or methods. It only traverses through Annotations! It also does not filter out platform dependent annotations!
public static <A extends Annotation> A findAnnotationRecursive(Class<?> clazz, Class<A> annotationType)
Annotation
of annotationType
on the supplied class.
Meta-annotations will be searched if the annotation is not directly present on the supplied element.
Note: this method searches for annotations at class & superClass(es)!
public static <A extends Annotation> A findAnnotation(AnnotatedElement annotatedElement, Class<A> annotationType, io.ebean.annotation.Platform platform)
public static <A extends Annotation> Set<A> findAnnotationsRecursive(Class<?> clazz, Class<A> annotationType)
public static <A extends Annotation> Set<A> findAnnotations(AnnotatedElement annotatedElement, Class<A> annotationType)
Annotation
s of annotationType
on the supplied AnnotatedElement
.
Meta-annotations will be searched if the annotation is not directly present on the supplied element.
Warning: this method operates generically on annotated elements. In other words, this method does not execute specialized search algorithms for classes or methods. It only traverses through Annotations!
public static <T extends Annotation> T getPlatformMatchingAnnotation(Set<T> anns, io.ebean.annotation.Platform matchPlatform)
Set anns
for this platform.
To distinguish between platforms, annotation type T
must define
a method withthis signature:
Class extends DatabasePlatform>[] platforms() default {};
ann[0]
databasePlatform
Where
and Formula
)Copyright © 2019. All rights reserved.