mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
提取获取注解属性值相关逻辑至注解属性值提取器
This commit is contained in:
@@ -108,7 +108,7 @@ public class AliasAnnotationPostProcessorTest {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getAttribute(String attributeName, Class<?> attributeType) {
|
||||
public Object getAttributeValue(String attributeName, Class<?> attributeType) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -185,6 +185,11 @@ public class AliasAnnotationPostProcessorTest {
|
||||
public Class<? extends Annotation> annotationType() {
|
||||
return annotation.annotationType();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getAttributeValue(String attributeName, Class<?> attributeType) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -136,7 +136,7 @@ public class AliasLinkAnnotationPostProcessorTest {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getAttribute(String attributeName, Class<?> attributeType) {
|
||||
public Object getAttributeValue(String attributeName, Class<?> attributeType) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -213,6 +213,11 @@ public class AliasLinkAnnotationPostProcessorTest {
|
||||
public Class<? extends Annotation> annotationType() {
|
||||
return annotation.annotationType();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getAttributeValue(String attributeName, Class<?> attributeType) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -42,6 +42,7 @@ public class AnnotationUtilTest {
|
||||
// 加别名适配
|
||||
final AnnotationForTest annotation = AnnotationUtil.getAnnotationAlias(ClassWithAnnotation.class, AnnotationForTest.class);
|
||||
Assert.assertEquals("测试", annotation.retry());
|
||||
Assert.assertTrue(AnnotationUtil.isSynthesizedAnnotation(annotation));
|
||||
}
|
||||
|
||||
@AnnotationForTest("测试")
|
||||
|
@@ -90,6 +90,10 @@ public class CacheableSynthesizedAnnotationAttributeProcessorTest {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getAttributeValue(String attributeName, Class<?> attributeType) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -110,7 +110,7 @@ public class MirrorLinkAnnotationPostProcessorTest {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getAttribute(String attributeName, Class<?> attributeType) {
|
||||
public Object getAttributeValue(String attributeName, Class<?> attributeType) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -188,6 +188,11 @@ public class MirrorLinkAnnotationPostProcessorTest {
|
||||
public Class<? extends Annotation> annotationType() {
|
||||
return annotation.annotationType();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getAttributeValue(String attributeName, Class<?> attributeType) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -136,6 +136,11 @@ public class SynthesizedAnnotationSelectorTest {
|
||||
public Class<? extends Annotation> annotationType() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getAttributeValue(String attributeName, Class<?> attributeType) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -60,10 +60,10 @@ public class SyntheticMetaAnnotationTest {
|
||||
Assert.assertEquals(syntheticMetaAnnotation.annotationType(), SynthesizedMetaAggregateAnnotation.class);
|
||||
Assert.assertEquals(3, syntheticMetaAnnotation.getAnnotations().length);
|
||||
|
||||
Assert.assertEquals("Child!", syntheticMetaAnnotation.getAttribute("childValue", String.class));
|
||||
Assert.assertEquals("Child!", syntheticMetaAnnotation.getAttribute("childValueAlias", String.class));
|
||||
Assert.assertEquals("Child's Parent!", syntheticMetaAnnotation.getAttribute("parentValue", String.class));
|
||||
Assert.assertEquals("Child's GrandParent!", syntheticMetaAnnotation.getAttribute("grandParentValue", String.class));
|
||||
Assert.assertEquals("Child!", syntheticMetaAnnotation.getAttributeValue("childValue", String.class));
|
||||
Assert.assertEquals("Child!", syntheticMetaAnnotation.getAttributeValue("childValueAlias", String.class));
|
||||
Assert.assertEquals("Child's Parent!", syntheticMetaAnnotation.getAttributeValue("parentValue", String.class));
|
||||
Assert.assertEquals("Child's GrandParent!", syntheticMetaAnnotation.getAttributeValue("grandParentValue", String.class));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
Reference in New Issue
Block a user