类 AsmAnnotationUtils

java.lang.Object
com.alibaba.bytekit.utils.AsmAnnotationUtils

public class AsmAnnotationUtils extends Object
作者:
hengyunabc 2020-05-04
  • 构造器详细资料

    • AsmAnnotationUtils

      public AsmAnnotationUtils()
  • 方法详细资料

    • queryAnnotationValue

      public static <T> T queryAnnotationValue(List<com.alibaba.deps.org.objectweb.asm.tree.AnnotationNode> annotations, String annotationType, String key)
      从注解中查找单个值,即使有重复注解也只返回第一个值
      类型参数:
      T -
      参数:
      annotations -
      annotationType -
      key -
      返回:
    • queryAnnotationValues

      public static <T> List<T> queryAnnotationValues(List<com.alibaba.deps.org.objectweb.asm.tree.AnnotationNode> annotations, String annotationType, String key)
      从注解中查找所有的值,如果有重复注解会返回所有值
      类型参数:
      T -
      参数:
      annotations -
      annotationType -
      key -
      返回:
    • queryAnnotationArrayValue

      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 -
      返回:
    • addAnnotationInfo

      public static void addAnnotationInfo(List<com.alibaba.deps.org.objectweb.asm.tree.AnnotationNode> annotations, String annotationType, String key, String value)