Class RepeatableAnnotationCollector.AbstractCollector

java.lang.Object
org.miaixz.bus.core.annotation.resolve.RepeatableAnnotationCollector.AbstractCollector
All Implemented Interfaces:
RepeatableAnnotationCollector
Direct Known Subclasses:
RepeatableAnnotationCollector.Condition, RepeatableAnnotationCollector.Full, RepeatableAnnotationCollector.Standard
Enclosing interface:
RepeatableAnnotationCollector

public abstract static class RepeatableAnnotationCollector.AbstractCollector extends Object implements RepeatableAnnotationCollector
RepeatableAnnotationCollector的基本实现
  • Constructor Details

    • AbstractCollector

      public AbstractCollector()
  • Method Details

    • getFinalRepeatableAnnotations

      public final List<Annotation> getFinalRepeatableAnnotations(Annotation annotation)
      若一个注解是可重复注解的容器注解,则尝试通过其属性获得获得包含的注解对象。 若包含的注解对象也是可重复注解的容器注解,则继续解析直到获得所有非容器注解为止。
      Specified by:
      getFinalRepeatableAnnotations in interface RepeatableAnnotationCollector
      Parameters:
      annotation - 容器注解
      Returns:
      容器注解中的可重复注解,若annotation不为容器注解,则数组中仅有其本身一个对象
    • getAllRepeatableAnnotations

      public List<Annotation> getAllRepeatableAnnotations(Annotation annotation)
      若一个注解是可重复注解的容器注解,则尝试通过其属性获得获得包含的注解对象。 若包含的注解对象也是可重复注解的容器注解,则继续解析直到获得所有非容器注解为止。 当accumulatetrue时,返回结果为全量的注解。 eg: 若存在嵌套关系a -> b -> c,则解析注解a, 将获得全部abc注解。 如果注解不包含可重复注解,则返回其本身。
      Specified by:
      getAllRepeatableAnnotations in interface RepeatableAnnotationCollector
      Parameters:
      annotation - 容器注解
      Returns:
      容器注解中的可重复注解,若annotation不为容器注解,则数组中仅有其本身一个对象
    • getRepeatableAnnotations

      public <T extends Annotation> List<T> getRepeatableAnnotations(Annotation annotation, Class<T> annotationType)
      若一个注解是可重复注解的容器注解,则尝试通过其属性获得获得包含的指定类型注解对象
      Specified by:
      getRepeatableAnnotations in interface RepeatableAnnotationCollector
      Type Parameters:
      T - 注解类型
      Parameters:
      annotation - 容器注解
      annotationType - 注解类型
      Returns:
      容器注解中的可重复注解
    • getRepeatableAnnotationsFormAttribute

      protected Annotation[] getRepeatableAnnotationsFormAttribute(Annotation annotation, Method method)
      调用value方法,获得嵌套的可重复注解
      Parameters:
      annotation - 注解对象
      method - 容纳可重复注解的方法
      Returns:
      可重复注解
      Throws:
      ClassCastException - 当method调用结果无法正确转为Annotation类型时抛出
    • resolveRepeatableMethod

      protected abstract List<Method> resolveRepeatableMethod(Annotation annotation)
      解析获得注解中存放可重复注解的属性
      Parameters:
      annotation - 注解
      Returns:
      属性