@@ -275,10 +275,8 @@ public static <A extends Annotation> A findAnnotation(Class<?> clazz, Class<A> a
275
275
* @param visited the set of annotations that have already been visited
276
276
* @return the annotation if found, or {@code null} if not found
277
277
*/
278
- private static <A extends Annotation > A findAnnotation (Class <?> clazz , Class <A > annotationType ,
279
- Set <Annotation > visited ) {
278
+ private static <A extends Annotation > A findAnnotation (Class <?> clazz , Class <A > annotationType , Set <Annotation > visited ) {
280
279
Assert .notNull (clazz , "Class must not be null" );
281
-
282
280
if (isAnnotationDeclaredLocally (annotationType , clazz )) {
283
281
return clazz .getAnnotation (annotationType );
284
282
}
@@ -424,10 +422,9 @@ public static boolean isAnnotationInherited(Class<? extends Annotation> annotati
424
422
}
425
423
426
424
/**
427
- * Determine if the supplied {@link Annotation} is defined in the
425
+ * Determine if the supplied {@link Annotation} is defined in the core JDK
428
426
* {@code java.lang.annotation} package.
429
- *
430
- * @param annotation the annotation to check; never {@code null}
427
+ * @param annotation the annotation to check (never {@code null})
431
428
* @return {@code true} if the annotation is in the {@code java.lang.annotation} package
432
429
*/
433
430
public static boolean isInJavaLangAnnotationPackage (Annotation annotation ) {
@@ -436,11 +433,10 @@ public static boolean isInJavaLangAnnotationPackage(Annotation annotation) {
436
433
}
437
434
438
435
/**
439
- * Retrieve the given annotation's attributes as a Map, preserving all attribute types
440
- * as-is.
441
- * <p>Note: As of Spring 3.1.1, the returned map is actually an
442
- * {@link AnnotationAttributes} instance, however the Map signature of this method has
443
- * been preserved for binary compatibility.
436
+ * Retrieve the given annotation's attributes as a {@link Map}, preserving all
437
+ * attribute types as-is.
438
+ * <p>Note: This method actually returns an {@link AnnotationAttributes} instance.
439
+ * However, the {@code Map} signature has been preserved for binary compatibility.
444
440
* @param annotation the annotation to retrieve the attributes for
445
441
* @return the Map of annotation attributes, with attribute names as keys and
446
442
* corresponding attribute values as values
@@ -450,16 +446,15 @@ public static Map<String, Object> getAnnotationAttributes(Annotation annotation)
450
446
}
451
447
452
448
/**
453
- * Retrieve the given annotation's attributes as a Map. Equivalent to calling
454
- * {@link #getAnnotationAttributes(Annotation, boolean, boolean)} with
449
+ * Retrieve the given annotation's attributes as a {@link Map} . Equivalent to
450
+ * calling {@link #getAnnotationAttributes(Annotation, boolean, boolean)} with
455
451
* the {@code nestedAnnotationsAsMap} parameter set to {@code false}.
456
- * <p>Note: As of Spring 3.1.1, the returned map is actually an
457
- * {@link AnnotationAttributes} instance, however the Map signature of this method has
458
- * been preserved for binary compatibility.
452
+ * <p>Note: This method actually returns an {@link AnnotationAttributes} instance.
453
+ * However, the {@code Map} signature has been preserved for binary compatibility.
459
454
* @param annotation the annotation to retrieve the attributes for
460
455
* @param classValuesAsString whether to turn Class references into Strings (for
461
- * compatibility with {@link org.springframework.core.type.AnnotationMetadata} or to
462
- * preserve them as Class references
456
+ * compatibility with {@link org.springframework.core.type.AnnotationMetadata}
457
+ * or to preserve them as Class references
463
458
* @return the Map of annotation attributes, with attribute names as keys and
464
459
* corresponding attribute values as values
465
460
*/
@@ -469,13 +464,13 @@ public static Map<String, Object> getAnnotationAttributes(Annotation annotation,
469
464
470
465
/**
471
466
* Retrieve the given annotation's attributes as an {@link AnnotationAttributes}
472
- * map structure. Implemented in Spring 3.1.1 to provide fully recursive annotation
473
- * reading capabilities on par with that of the reflection-based
474
- * {@link org.springframework.core.type.StandardAnnotationMetadata}.
467
+ * map structure.
468
+ * <p>This method provides fully recursive annotation reading capabilities on par with
469
+ * the reflection-based {@link org.springframework.core.type.StandardAnnotationMetadata}.
475
470
* @param annotation the annotation to retrieve the attributes for
476
471
* @param classValuesAsString whether to turn Class references into Strings (for
477
- * compatibility with {@link org.springframework.core.type.AnnotationMetadata} or to
478
- * preserve them as Class references
472
+ * compatibility with {@link org.springframework.core.type.AnnotationMetadata}
473
+ * or to preserve them as Class references
479
474
* @param nestedAnnotationsAsMap whether to turn nested Annotation instances into
480
475
* {@link AnnotationAttributes} maps (for compatibility with
481
476
* {@link org.springframework.core.type.AnnotationMetadata} or to preserve them as
@@ -543,7 +538,7 @@ public static Object getValue(Annotation annotation) {
543
538
}
544
539
545
540
/**
546
- * Retrieve the <em>value</em> of a named Annotation attribute, given an annotation instance.
541
+ * Retrieve the <em>value</em> of a named attribute, given an annotation instance.
547
542
* @param annotation the annotation instance from which to retrieve the value
548
543
* @param attributeName the name of the attribute value to retrieve
549
544
* @return the attribute value, or {@code null} if not found
@@ -572,7 +567,7 @@ public static Object getDefaultValue(Annotation annotation) {
572
567
}
573
568
574
569
/**
575
- * Retrieve the <em>default value</em> of a named Annotation attribute, given an annotation instance.
570
+ * Retrieve the <em>default value</em> of a named attribute, given an annotation instance.
576
571
* @param annotation the annotation instance from which to retrieve the default value
577
572
* @param attributeName the name of the attribute value to retrieve
578
573
* @return the default value of the named attribute, or {@code null} if not found
@@ -594,7 +589,8 @@ public static Object getDefaultValue(Class<? extends Annotation> annotationType)
594
589
}
595
590
596
591
/**
597
- * Retrieve the <em>default value</em> of a named Annotation attribute, given the {@link Class annotation type}.
592
+ * Retrieve the <em>default value</em> of a named attribute, given the
593
+ * {@link Class annotation type}.
598
594
* @param annotationType the <em>annotation type</em> for which the default value should be retrieved
599
595
* @param attributeName the name of the attribute value to retrieve.
600
596
* @return the default value of the named attribute, or {@code null} if not found
0 commit comments