public interface RepeatableMappingRegistry
可重复注解映射关系注册表,用于集中管理RepeatableMapping,
并提供间接关联的容器注解与元素注解间的转换功能
RepeatableMapping| 限定符和类型 | 方法和说明 |
|---|---|
static RepeatableMappingRegistry |
create()
创建一个默认的映射关系注册表,支持处理原生的
Repeatable注解与RepeatableBy注解 |
List<Annotation> |
getAllElementsFromContainer(Annotation container)
获取注解容器中的全部的元素注解
|
List<RepeatableMapping> |
getContainers(Class<? extends Annotation> annotationType)
获取指定注解的容器注解
|
<T extends Annotation> |
getElementsFromContainer(Annotation container,
Class<T> elementType)
从容器注解中获得指定的元素注解,若该容器注解不为指定对元素的容器,或任意一者为空时返回null
|
boolean |
hasContainer(Class<? extends Annotation> annotationType)
指定注解是否存容器注解
|
boolean |
isContainer(Class<? extends Annotation> annotationType)
指定注解是否为一个容器注解
|
boolean |
isContainerOf(Class<? extends Annotation> elementType,
Class<? extends Annotation> containerType)
containerType是否为elementType的容器注解 |
void |
register(Class<? extends Annotation> annotationType)
注册指定注解类
|
void |
registerMappingParser(RepeatableMappingParser mappingParser)
注册关系解析器
|
static RepeatableMappingRegistry create()
Repeatable注解与RepeatableBy注解void registerMappingParser(RepeatableMappingParser mappingParser)
mappingParser - 关系解析器void register(Class<? extends Annotation> annotationType)
annotationType - 注解类boolean isContainer(Class<? extends Annotation> annotationType)
annotationType - 注解类型boolean hasContainer(Class<? extends Annotation> annotationType)
annotationType - 注解类型boolean isContainerOf(Class<? extends Annotation> elementType, Class<? extends Annotation> containerType)
containerType是否为elementType的容器注解elementType - 元素注解类型containerType - 容器注解类型List<RepeatableMapping> getContainers(Class<? extends Annotation> annotationType)
annotationType - 注解类型List<Annotation> getAllElementsFromContainer(Annotation container)
container - 容器对象<T extends Annotation> List<T> getElementsFromContainer(Annotation container, Class<T> elementType)
container - 容器注解对象elementType - 元素注解类型Copyright © 2022. All rights reserved.