Class CacheableProcessor

java.lang.Object
org.aoju.bus.core.scanner.CacheableProcessor
All Implemented Interfaces:
SynthesizedProcessor

public class CacheableProcessor extends Object implements SynthesizedProcessor
带缓存功能的SynthesizedProcessor实现, 构建时需要传入比较器,获取属性值时将根据比较器对合成注解进行排序, 然后选择具有所需属性的,排序最靠前的注解用于获取属性值
Since:
Java 17+
Author:
Kimi Liu
  • Constructor Details

    • CacheableProcessor

      public CacheableProcessor(Comparator<Synthesized> annotationComparator)
      创建一个带缓存的注解值选择器
      Parameters:
      annotationComparator - 注解比较器,排序更靠前的注解将被优先用于获取值
  • Method Details

    • getAttributeValue

      public <T> T getAttributeValue(String attributeName, Class<T> attributeType, Collection<? extends Synthesized> synthesizedAnnotations)
      Description copied from interface: SynthesizedProcessor
      从一批被合成注解中,获取指定名称与类型的属性值
      Specified by:
      getAttributeValue in interface SynthesizedProcessor
      Type Parameters:
      T - 属性类型
      Parameters:
      attributeName - 属性名称
      attributeType - 属性类型
      synthesizedAnnotations - 被合成的注解
      Returns:
      属性值