public abstract class AnnotationParser
extends 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) |
| 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.
|
void |
visit(java.lang.String name,
java.lang.Object value) |
AnnotationVisitor |
visitAnnotation(java.lang.String name,
java.lang.String descriptor) |
AnnotationVisitor |
visitArray(java.lang.String name) |
void |
visitEnum(java.lang.String name,
java.lang.String descriptor,
java.lang.String value) |
abstract void |
visitValue(java.lang.String name,
java.lang.Object value) |
protected final AnnotationParser.ClassLookup abstractions
protected AnnotationParser(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 abstract void visitValue(java.lang.String name,
java.lang.Object value)
public void visit(java.lang.String name,
java.lang.Object value)
public void visitEnum(java.lang.String name,
java.lang.String descriptor,
java.lang.String value)
public AnnotationVisitor visitAnnotation(java.lang.String name,
java.lang.String descriptor)
public AnnotationVisitor visitArray(java.lang.String name)