Cross reference annotation search APIs in Javadoc

Closes gh-34421
This commit is contained in:
Sam Brannen
2025-02-13 14:30:02 +01:00
parent 1109892134
commit d82e70e345
4 changed files with 35 additions and 19 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2022 the original author or authors.
* Copyright 2002-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -36,8 +36,12 @@ import org.springframework.util.MultiValueMap;
*
* <p>{@code AnnotatedElementUtils} defines the public API for Spring's
* meta-annotation programming model with support for <em>annotation attribute
* overrides</em>. If you do not need support for annotation attribute
* overrides, consider using {@link AnnotationUtils} instead.
* overrides</em> and {@link AliasFor @AliasFor}. Note, however, that
* {@code AnnotatedElementUtils} is effectively a facade for the
* {@link MergedAnnotations} API. For fine-grained support consider using the
* {@code MergedAnnotations} API directly. If you do not need support for
* annotation attribute overrides, {@code @AliasFor}, or merged annotations,
* consider using {@link AnnotationUtils} instead.
*
* <p>Note that the features of this class are not provided by the JDK's
* introspection facilities themselves.
@@ -87,6 +91,7 @@ import org.springframework.util.MultiValueMap;
* @since 4.0
* @see AliasFor
* @see AnnotationAttributes
* @see MergedAnnotations
* @see AnnotationUtils
* @see BridgeMethodResolver
*/

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2024 the original author or authors.
* Copyright 2002-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -60,7 +60,7 @@ import org.springframework.util.StringUtils;
* <h3>Terminology</h3>
* The terms <em>directly present</em>, <em>indirectly present</em>, and
* <em>present</em> have the same meanings as defined in the class-level
* javadoc for {@link AnnotatedElement} (in Java 8).
* javadoc for {@link AnnotatedElement}.
*
* <p>An annotation is <em>meta-present</em> on an element if the annotation
* is declared as a meta-annotation on some other annotation which is
@@ -73,7 +73,8 @@ import org.springframework.util.StringUtils;
* provide support for finding annotations used as meta-annotations. Consult the
* javadoc for each method in this class for details. For fine-grained support for
* meta-annotations with <em>attribute overrides</em> in <em>composed annotations</em>,
* consider using {@link AnnotatedElementUtils}'s more specific methods instead.
* consider using the {@link MergedAnnotations} API directly or the more specific
* methods in {@link AnnotatedElementUtils} instead.
*
* <h3>Attribute Aliases</h3>
* <p>All public methods in this class that return annotations, arrays of
@@ -97,6 +98,7 @@ import org.springframework.util.StringUtils;
* @since 2.0
* @see AliasFor
* @see AnnotationAttributes
* @see MergedAnnotations
* @see AnnotatedElementUtils
* @see BridgeMethodResolver
* @see java.lang.reflect.AnnotatedElement#getAnnotations()

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2023 the original author or authors.
* Copyright 2002-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -37,7 +37,7 @@ import org.springframework.util.Assert;
* <ul>
* <li>Explicit and Implicit {@link AliasFor @AliasFor} declarations on one or
* more attributes within the annotation</li>
* <li>Explicit {@link AliasFor @AliasFor} declarations for a meta-annotation</li>
* <li>Explicit {@code @AliasFor} declarations for a meta-annotation</li>
* <li>Convention based attribute aliases for a meta-annotation</li>
* <li>From a meta-annotation declaration</li>
* </ul>
@@ -140,6 +140,9 @@ import org.springframework.util.Assert;
* @see MergedAnnotationCollectors
* @see MergedAnnotationPredicates
* @see MergedAnnotationSelectors
* @see AliasFor
* @see AnnotationUtils
* @see AnnotatedElementUtils
*/
public interface MergedAnnotations extends Iterable<MergedAnnotation<Annotation>> {
@@ -560,6 +563,7 @@ public interface MergedAnnotations extends Iterable<MergedAnnotation<Annotation>
* @see #withRepeatableContainers(RepeatableContainers)
* @see #withAnnotationFilter(AnnotationFilter)
* @see #from(AnnotatedElement)
* @see org.springframework.test.context.TestContextAnnotationUtils#searchEnclosingClass(Class)
*/
public Search withEnclosingClasses(Predicate<Class<?>> searchEnclosingClass) {
Assert.notNull(searchEnclosingClass, "Predicate must not be null");