Package | Description |
---|---|
org.dromara.hutool.core.annotation |
注解包,提供增强型注解和注解工具类,处理包括:
注解元素(AnnotatedElement)上的注解。 |
org.dromara.hutool.core.annotation.elements |
AnnotatedElement对象实现
|
Modifier and Type | Class and Description |
---|---|
static class |
RepeatableAnnotationCollector.AbstractCollector
RepeatableAnnotationCollector 的基本实现 |
static class |
RepeatableAnnotationCollector.Condition
自定义判断条件的实现,当解析注解属性时,将根据给定的判断条件,
确定该属性中是否含有可重复注解,收集器将返回所有匹配的属性中的可重复注解。
|
static class |
RepeatableAnnotationCollector.Full
全量实现,当注解中存在有属性为注解数组,且该数组对应的注解类型被
Repeatable 注解时,
认为该属性包含可重复注解。 |
static class |
RepeatableAnnotationCollector.None
空实现
|
static class |
RepeatableAnnotationCollector.Standard
标准实现,当注解中有且仅有一个名为
value 的属性时,
若该属性类型为注解数组,且该数组对应的注解类型被Repeatable 注解,
则收集器将返回该属性中包括的可重复注解。 |
Modifier and Type | Method and Description |
---|---|
static RepeatableAnnotationCollector |
RepeatableAnnotationCollector.condition(BiPredicate<Annotation,Method> predicate)
当解析注解属性时,将根据给定的判断条件,确定该属性中是否含有可重复注解。
|
static RepeatableAnnotationCollector |
RepeatableAnnotationCollector.full()
当注解中存在有属性为注解数组,且该数组对应的注解类型被
Repeatable 注解时,
认为该属性包含可重复注解。 |
static RepeatableAnnotationCollector |
RepeatableAnnotationCollector.none()
空实现
|
static RepeatableAnnotationCollector |
RepeatableAnnotationCollector.standard()
当注解中有且仅有一个名为
value 的属性时,
若该属性类型为注解数组,且该数组对应的注解类型被Repeatable 注解,
则收集器将返回该属性中包括的可重复注解。 |
Modifier and Type | Method and Description |
---|---|
static AnnotatedElement |
AnnotatedElementUtil.toRepeatableMetaElement(AnnotatedElement element,
RepeatableAnnotationCollector collector,
boolean resolved)
将
AnnotatedElement 转为RepeatableMetaAnnotatedElement ,
得到的对象可访问AnnotatedElement 上的直接声明的注解,
通过collector 从这些注解获得的可重复注解,以及上述注解的所有元注解。 |
Modifier and Type | Method and Description |
---|---|
static <A extends AnnotationMapping<Annotation>> |
RepeatableMetaAnnotatedElement.create(RepeatableAnnotationCollector collector,
AnnotatedElement element,
BiFunction<A,Annotation,A> mappingFactory)
获取
AnnotatedElement 上的注解结构,该方法会针对相同的AnnotatedElement 缓存映射对象 |
Copyright © 2025. All rights reserved.