T - The type of the annotationpublic class AnnotationParser<T extends java.lang.annotation.Annotation>
extends java.lang.Object
| Constructor and Description |
|---|
AnnotationParser(java.lang.Class<T> type,
IClassProvider classProvider) |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
hasAnnotation(java.util.List<org.objectweb.asm.tree.AnnotationNode> nodes,
java.lang.String desc)
Check if the given list of annotation nodes contains an annotation of the given type.
|
static java.util.Map<java.lang.String,java.lang.Object> |
listToMap(java.util.List<java.lang.Object> list)
Convert the raw ASM bytecode values list to a map.
|
static java.util.List<java.lang.Object> |
mapToList(java.util.Map<java.lang.String,java.lang.Object> map)
Convert a map to a raw ASM bytecode values list.
|
static <T extends java.lang.annotation.Annotation> |
parse(java.lang.Class<T> type,
IClassProvider classProvider,
java.util.Map<java.lang.String,java.lang.Object> values)
Create a new instance for the given annotation class.
|
T |
parse(java.util.Map<java.lang.String,java.lang.Object> values)
Parse the given key value pairs to a new instance of the annotation.
|
public AnnotationParser(java.lang.Class<T> type, IClassProvider classProvider)
public static <T extends java.lang.annotation.Annotation> T parse(java.lang.Class<T> type,
IClassProvider classProvider,
java.util.Map<java.lang.String,java.lang.Object> values)
T - The type of the annotationtype - The annotation classclassProvider - The class provider to get the bytecode fromvalues - The raw values of the annotationpublic static java.util.Map<java.lang.String,java.lang.Object> listToMap(java.util.List<java.lang.Object> list)
list - The raw ASM bytecode values listjava.lang.IndexOutOfBoundsException - If the list is does not contain key value pairspublic static java.util.List<java.lang.Object> mapToList(java.util.Map<java.lang.String,java.lang.Object> map)
map - The mappublic static boolean hasAnnotation(java.util.List<org.objectweb.asm.tree.AnnotationNode> nodes,
java.lang.String desc)
nodes - The list of annotation nodesdesc - The descriptor of the annotationpublic T parse(java.util.Map<java.lang.String,java.lang.Object> values)
values - The key value pairs