public class AsmAnnotationUtils extends Object
| 构造器和说明 |
|---|
AsmAnnotationUtils() |
| 限定符和类型 | 方法和说明 |
|---|---|
static void |
addAnnotationInfo(List<com.alibaba.deps.org.objectweb.asm.tree.AnnotationNode> annotations,
String annotationType,
String key,
String value) |
static <T> List<T> |
queryAnnotationArrayValue(List<com.alibaba.deps.org.objectweb.asm.tree.AnnotationNode> annotations,
String annotationType,
String key)
从注解中查找 数组 字段的值,返回非null 的 List。
|
static <T> T |
queryAnnotationValue(List<com.alibaba.deps.org.objectweb.asm.tree.AnnotationNode> annotations,
String annotationType,
String key)
从注解中查找单个值,即使有重复注解也只返回第一个值
|
static <T> List<T> |
queryAnnotationValues(List<com.alibaba.deps.org.objectweb.asm.tree.AnnotationNode> annotations,
String annotationType,
String key)
从注解中查找所有的值,如果有重复注解会返回所有值
|
public static <T> T queryAnnotationValue(List<com.alibaba.deps.org.objectweb.asm.tree.AnnotationNode> annotations, String annotationType, String key)
T - annotations - annotationType - key - public static <T> List<T> queryAnnotationValues(List<com.alibaba.deps.org.objectweb.asm.tree.AnnotationNode> annotations, String annotationType, String key)
T - annotations - annotationType - key - public static <T> List<T> queryAnnotationArrayValue(List<com.alibaba.deps.org.objectweb.asm.tree.AnnotationNode> annotations, String annotationType, String key)
从注解中查找 数组 字段的值,返回非null 的 List。 比如 `@Test(names = {"abc", "xyz"})` ,返回 List包含
"abc", "xyz" 两个元素
annotations - annotationType - key - Copyright © 2018–2023. All rights reserved.