Add MergedAnnotations support to meta-data classes
Add `AnnotatedTypeMetaData.getAnnotations()` that can be used to access
annotation details using the `MergedAnnotations` interface.
Where possible, the existing annotation methods have been migrated to
call `getAnnotation()`, rather than needing their own implementation.
The existing ASM based meta-data implementations have not been updated
since they will be deprecated and replaced in a subsequent commit.
See gh-22884
pull/25019/head
Phillip Webb6 years agocommitted byJuergen Hoeller
@ -69,72 +74,49 @@ public class StandardAnnotationMetadata extends StandardClassMetadata implements
@@ -69,72 +74,49 @@ public class StandardAnnotationMetadata extends StandardClassMetadata implements
@ -143,8 +125,7 @@ public class StandardAnnotationMetadata extends StandardClassMetadata implements
@@ -143,8 +125,7 @@ public class StandardAnnotationMetadata extends StandardClassMetadata implements
@ -158,13 +139,15 @@ public class StandardAnnotationMetadata extends StandardClassMetadata implements
@@ -158,13 +139,15 @@ public class StandardAnnotationMetadata extends StandardClassMetadata implements
@ -173,7 +156,12 @@ public class StandardAnnotationMetadata extends StandardClassMetadata implements
@@ -173,7 +156,12 @@ public class StandardAnnotationMetadata extends StandardClassMetadata implements
thrownewIllegalStateException("Failed to introspect annotated methods on "+getIntrospectedClass(),ex);
@ -41,6 +45,8 @@ public class StandardMethodMetadata implements MethodMetadata {
@@ -41,6 +45,8 @@ public class StandardMethodMetadata implements MethodMetadata {
@ -65,8 +71,15 @@ public class StandardMethodMetadata implements MethodMetadata {
@@ -65,8 +71,15 @@ public class StandardMethodMetadata implements MethodMetadata {
Assert.notNull(introspectedMethod,"Method must not be null");
@ -107,17 +120,19 @@ public class StandardMethodMetadata implements MethodMetadata {
@@ -107,17 +120,19 @@ public class StandardMethodMetadata implements MethodMetadata {
@ -125,6 +140,9 @@ public class StandardMethodMetadata implements MethodMetadata {
@@ -125,6 +140,9 @@ public class StandardMethodMetadata implements MethodMetadata {
@ -72,6 +73,11 @@ public class AnnotationMetadataReadingVisitor extends ClassMetadataReadingVisito
@@ -72,6 +73,11 @@ public class AnnotationMetadataReadingVisitor extends ClassMetadataReadingVisito
// Skip bridge methods - we're only interested in original annotation-defining user methods.
@ -129,6 +135,11 @@ public class AnnotationMetadataReadingVisitor extends ClassMetadataReadingVisito
@@ -129,6 +135,11 @@ public class AnnotationMetadataReadingVisitor extends ClassMetadataReadingVisito
@ -137,6 +138,16 @@ public abstract class AbstractAnnotationMetadataTests {
@@ -137,6 +138,16 @@ public abstract class AbstractAnnotationMetadataTests {
@ -57,4 +62,10 @@ public class MethodMetadataReadingVisitorTests extends AbstractMethodMetadataTes
@@ -57,4 +62,10 @@ public class MethodMetadataReadingVisitorTests extends AbstractMethodMetadataTes