public abstract class AnnotationParser
extends org.objectweb.asm.AnnotationVisitor
AnnotationVisitor implementation, which produces annotation
instances, similar to Java Reflection.
Created by covers1624 on 22/6/23.
| Modifier and Type | Class and Description |
|---|---|
static class |
AnnotationParser.AnnotationParseException
Thrown if there is any error during the annotation parsing process.
|
static interface |
AnnotationParser.ClassLookup
Abstractions for class lookups, which may be different on different platforms.
|
| Modifier and Type | Field and Description |
|---|---|
protected AnnotationParser.ClassLookup |
abstractions |
| Modifier | Constructor and Description |
|---|---|
protected |
AnnotationParser(AnnotationParser.ClassLookup abstractions)
Deprecated.
|
protected |
AnnotationParser(@Nullable org.objectweb.asm.AnnotationVisitor delegate,
AnnotationParser.ClassLookup abstractions) |
| Modifier and Type | Method and Description |
|---|---|
static AnnotationParser |
newVisitor(AnnotationParser.ClassLookup lookup,
java.lang.String desc,
java.util.function.Consumer<java.lang.annotation.Annotation> cons)
Create a visitor.
|
static AnnotationParser |
newVisitor(@Nullable org.objectweb.asm.AnnotationVisitor delegate,
AnnotationParser.ClassLookup lookup,
java.lang.String desc,
java.util.function.Consumer<java.lang.annotation.Annotation> cons)
Create a visitor.
|
void |
visit(@Nullable java.lang.String name,
java.lang.Object value) |
org.objectweb.asm.AnnotationVisitor |
visitAnnotation(java.lang.String name,
java.lang.String descriptor) |
org.objectweb.asm.AnnotationVisitor |
visitArray(java.lang.String name) |
void |
visitEnum(java.lang.String name,
java.lang.String descriptor,
java.lang.String value) |
abstract void |
visitValue(@Nullable java.lang.String name,
java.lang.Object value) |
protected final AnnotationParser.ClassLookup abstractions
@Deprecated @ApiStatus.ScheduledForRemoval(inVersion="0.5") protected AnnotationParser(AnnotationParser.ClassLookup abstractions)
protected AnnotationParser(@Nullable
@Nullable org.objectweb.asm.AnnotationVisitor delegate,
AnnotationParser.ClassLookup abstractions)
public static AnnotationParser newVisitor(AnnotationParser.ClassLookup lookup, java.lang.String desc, java.util.function.Consumer<java.lang.annotation.Annotation> cons) throws AnnotationParser.AnnotationParseException
The visitor when piped annotation data will provide the loaded annotation object and the class it was loaded from via the provided consumer.
lookup - The class lookup.desc - The descriptor of the annotation.cons - The consumer to accept the parsed annotations.AnnotationVisitor implementation.AnnotationParser.AnnotationParseExceptionpublic static AnnotationParser newVisitor(@Nullable @Nullable org.objectweb.asm.AnnotationVisitor delegate, AnnotationParser.ClassLookup lookup, java.lang.String desc, java.util.function.Consumer<java.lang.annotation.Annotation> cons) throws AnnotationParser.AnnotationParseException
The visitor when piped annotation data will provide the loaded annotation object and the class it was loaded from via the provided consumer.
delegate - The AnnotationVisitor to delegate calls to.lookup - The class lookup.desc - The descriptor of the annotation.cons - The consumer to accept the parsed annotations.AnnotationVisitor implementation.AnnotationParser.AnnotationParseExceptionpublic abstract void visitValue(@Nullable
@Nullable java.lang.String name,
java.lang.Object value)
public void visit(@Nullable
@Nullable java.lang.String name,
java.lang.Object value)
visit in class org.objectweb.asm.AnnotationVisitorpublic void visitEnum(java.lang.String name,
java.lang.String descriptor,
java.lang.String value)
visitEnum in class org.objectweb.asm.AnnotationVisitorpublic org.objectweb.asm.AnnotationVisitor visitAnnotation(java.lang.String name,
java.lang.String descriptor)
visitAnnotation in class org.objectweb.asm.AnnotationVisitorpublic org.objectweb.asm.AnnotationVisitor visitArray(java.lang.String name)
visitArray in class org.objectweb.asm.AnnotationVisitor