public abstract class AbstractDynamicAttributeResolver extends Object implements SyntheticAnnotationResolver
SyntheticAnnotationResolver的基本实现,
用于处理注解中带有Link注解的属性。ALIAS_ATTRIBUTE_RESOLVER_ORDER, COVERED_ATTRIBUTE_RESOLVER_ORDER, MIRROR_ATTRIBUTE_RESOLVER_ORDER| 构造器和说明 |
|---|
AbstractDynamicAttributeResolver() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitorderpublic void resolve(Collection<HierarchicalAnnotation<Annotation>> annotations, AnnotationSynthesizer synthesizer)
Link注解,注解的Link.type()返回值在processTypes()中存在,
且此Link指定的注解对象在当前的AnnotationSynthesizer中存在,
则从聚合器中获取类型对应的合成注解对象,与该对象中的指定属性,然后将全部关联数据交给
processLinkedAttribute(top.xiajibagao.powerfulannotation.synthesis.AnnotationSynthesizer, top.xiajibagao.powerfulannotation.synthesis.Link, top.xiajibagao.powerfulannotation.annotation.HierarchicalAnnotation<java.lang.annotation.Annotation>, top.xiajibagao.powerfulannotation.annotation.attribute.AnnotationAttribute, top.xiajibagao.powerfulannotation.annotation.HierarchicalAnnotation<java.lang.annotation.Annotation>, top.xiajibagao.powerfulannotation.annotation.attribute.AnnotationAttribute)处理。resolve 在接口中 SyntheticAnnotationResolverannotations - 合成的注解synthesizer - 合成注解聚合器protected abstract RelationType[] processTypes()
Link注解时,仅当Link.type()在本方法返回值内存在时才进行处理RelationType类型protected abstract void processLinkedAttribute(AnnotationSynthesizer synthesizer, Link annotation, HierarchicalAnnotation<Annotation> originalAnnotation, AnnotationAttribute originalAttribute, HierarchicalAnnotation<Annotation> linkedAnnotation, AnnotationAttribute linkedAttribute)
protected Link getAttributeAnnotation(AnnotationAttribute attribute, RelationType... relationTypes)
Link注解attribute - 注解属性relationTypes - 类型protected HierarchicalAnnotation<Annotation> getLinkedAnnotation(Link annotation, AnnotationSynthesizer synthesizer, Class<? extends Annotation> defaultType)
Link.type()指定的注解对象annotation - Link注解synthesizer - 注解合成器defaultType - 默认类型protected Class<?> getLinkedAnnotationType(Link annotation, Class<?> defaultType)
annotation - Link注解defaultType - 默认注解类型protected void checkAttributeType(AnnotationAttribute original, AnnotationAttribute alias)
original - 原属性alias - 别名属性protected void checkLinkedSelf(AnnotationAttribute original, AnnotationAttribute linked)
Link指向的注解属性是否就是本身protected void checkLinkedAttributeNotNull(AnnotationAttribute original, AnnotationAttribute linkedAttribute, Link annotation)
Link指向的注解属性是否存在Copyright © 2022. All rights reserved.