public class AnnotationLoader
extends java.lang.Object
Created by covers1624 on 21/6/23.
| Constructor and Description |
|---|
AnnotationLoader() |
AnnotationLoader(AnnotationParser.ClassLookup lookup) |
AnnotationLoader(AnnotationParser.ClassLookup lookup,
boolean ignoreMissing) |
AnnotationLoader(boolean ignoreMissing) |
| Modifier and Type | Method and Description |
|---|---|
static <T extends java.lang.annotation.Annotation> |
expandRepeatable(java.lang.annotation.Annotation ann)
If the given annotation is a
Repeatable annotation, expand it into
the contained annotations. |
ClassVisitor |
forClass()
Returns a
ClassVisitor which will consume class annotations into
this AnnotationLoader. |
FieldVisitor |
forField()
Returns a
FieldVisitor which will consume field annotations into
this AnnotationLoader. |
MethodVisitor |
forMethod()
Returns a
MethodVisitor which will consume method annotations into
this AnnotationLoader. |
java.util.Set<java.lang.Class<? extends java.lang.annotation.Annotation>> |
getAllTypes()
Get all annotation types..
|
java.util.Set<java.lang.Class<? extends java.lang.annotation.Annotation>> |
getAllTypes(boolean visible)
Get all annotation types..
|
<T extends java.lang.annotation.Annotation> |
getAnnotation(java.lang.Class<T> clazz)
Get a single annotation of the specified type.
|
<T extends java.lang.annotation.Annotation> |
getAnnotation(java.lang.Class<T> clazz,
boolean visible)
Get a single annotation of the specified type.
|
<T extends java.lang.annotation.Annotation> |
getAnnotations(java.lang.Class<T> clazz)
Get all annotation of the specified type.
|
<T extends java.lang.annotation.Annotation> |
getAnnotations(java.lang.Class<T> clazz,
boolean visible)
Get all annotation of the specified type.
|
public AnnotationLoader()
public AnnotationLoader(boolean ignoreMissing)
public AnnotationLoader(AnnotationParser.ClassLookup lookup)
public AnnotationLoader(AnnotationParser.ClassLookup lookup, boolean ignoreMissing)
public ClassVisitor forClass()
ClassVisitor which will consume class annotations into
this AnnotationLoader.public MethodVisitor forMethod()
MethodVisitor which will consume method annotations into
this AnnotationLoader.public FieldVisitor forField()
FieldVisitor which will consume field annotations into
this AnnotationLoader.public <T extends java.lang.annotation.Annotation> T getAnnotation(java.lang.Class<T> clazz)
If there is more than one annotation, the first is returned.
clazz - The annotation class.public <T extends java.lang.annotation.Annotation> T getAnnotation(java.lang.Class<T> clazz,
boolean visible)
If there is more than one annotation, the first is returned.
clazz - The annotation class.visible - If the runtime visible or invisible annotation list should be queried.public <T extends java.lang.annotation.Annotation> T[] getAnnotations(java.lang.Class<T> clazz)
clazz - The annotation class.public <T extends java.lang.annotation.Annotation> T[] getAnnotations(java.lang.Class<T> clazz,
boolean visible)
clazz - The annotation class.visible - If the runtime visible or invisible annotation list should be queried.public java.util.Set<java.lang.Class<? extends java.lang.annotation.Annotation>> getAllTypes()
public java.util.Set<java.lang.Class<? extends java.lang.annotation.Annotation>> getAllTypes(boolean visible)
visible - If the runtime visible or invisible annotation list should be queried.public static <T extends java.lang.annotation.Annotation> T[] expandRepeatable(java.lang.annotation.Annotation ann)
Repeatable annotation, expand it into
the contained annotations.ann - The annotation to expand.null if the annotation is not
repeatable and no expansion is possible.