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. |
org.objectweb.asm.ClassVisitor |
forClass()
Returns a
ClassVisitor which will consume class annotations into
this AnnotationLoader. |
org.objectweb.asm.ClassVisitor |
forClass(@Nullable org.objectweb.asm.ClassVisitor delegate)
Returns a
ClassVisitor which will consume class annotations into
this AnnotationLoader. |
org.objectweb.asm.FieldVisitor |
forField()
Overload of
forField(FieldVisitor). |
org.objectweb.asm.FieldVisitor |
forField(@Nullable org.objectweb.asm.FieldVisitor delegate)
Returns a
FieldVisitor which will consume field annotations into
this AnnotationLoader. |
org.objectweb.asm.MethodVisitor |
forMethod()
Returns a
MethodVisitor which will consume method annotations into
this AnnotationLoader. |
org.objectweb.asm.MethodVisitor |
forMethod(@Nullable org.objectweb.asm.MethodVisitor delegate)
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 org.objectweb.asm.ClassVisitor forClass()
ClassVisitor which will consume class annotations into
this AnnotationLoader.public org.objectweb.asm.ClassVisitor forClass(@Nullable
@Nullable org.objectweb.asm.ClassVisitor delegate)
ClassVisitor which will consume class annotations into
this AnnotationLoader.public org.objectweb.asm.MethodVisitor forMethod()
MethodVisitor which will consume method annotations into
this AnnotationLoader.public org.objectweb.asm.MethodVisitor forMethod(@Nullable
@Nullable org.objectweb.asm.MethodVisitor delegate)
MethodVisitor which will consume method annotations into
this AnnotationLoader.delegate - Additionally chain visited data to the given delegate.public org.objectweb.asm.FieldVisitor forField()
forField(FieldVisitor).public org.objectweb.asm.FieldVisitor forField(@Nullable
@Nullable org.objectweb.asm.FieldVisitor delegate)
FieldVisitor which will consume field annotations into
this AnnotationLoader.delegate - Additionally chain visited data to the given delegate.@Nullable 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.@Nullable
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.