From b9f85627a17a55270d5ba3d3b6e7b7d267ba8817 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Deleuze?= Date: Thu, 9 Jun 2022 14:38:10 +0200 Subject: [PATCH] Improve ResourcePatternHint documentation Closes gh-28598 --- .../springframework/aot/hint/ResourceHints.java | 2 +- .../aot/hint/ResourcePatternHint.java | 16 +++++++++++++++- .../aot/hint/ResourcePatternHints.java | 8 ++++---- 3 files changed, 20 insertions(+), 6 deletions(-) diff --git a/spring-core/src/main/java/org/springframework/aot/hint/ResourceHints.java b/spring-core/src/main/java/org/springframework/aot/hint/ResourceHints.java index 7f47d580e5..2737aacb3f 100644 --- a/spring-core/src/main/java/org/springframework/aot/hint/ResourceHints.java +++ b/spring-core/src/main/java/org/springframework/aot/hint/ResourceHints.java @@ -83,7 +83,7 @@ public class ResourceHints { /** * Register that the resources matching the specified pattern should be * made available at runtime. - * @param include a pattern of the resources to include + * @param include a pattern of the resources to include (see {@link ResourcePatternHint} documentation) * @return {@code this}, to facilitate method chaining */ public ResourceHints registerPattern(String include) { diff --git a/spring-core/src/main/java/org/springframework/aot/hint/ResourcePatternHint.java b/spring-core/src/main/java/org/springframework/aot/hint/ResourcePatternHint.java index 234b90f97e..cfab75d5ac 100644 --- a/spring-core/src/main/java/org/springframework/aot/hint/ResourcePatternHint.java +++ b/spring-core/src/main/java/org/springframework/aot/hint/ResourcePatternHint.java @@ -22,12 +22,26 @@ import org.springframework.lang.Nullable; /** * A hint that describes resources that should be made available at runtime. + * *

The patterns may be a simple path which has a one-to-one mapping to a * resource on the classpath, or alternatively may contain the special - * {@code *} character to indicate a wildcard search. + * {@code *} character to indicate a wildcard search. For example: + *

* * @author Stephane Nicoll * @author Brian Clozel + * @author Sebastien Deleuze * @since 6.0 */ public final class ResourcePatternHint implements ConditionalHint { diff --git a/spring-core/src/main/java/org/springframework/aot/hint/ResourcePatternHints.java b/spring-core/src/main/java/org/springframework/aot/hint/ResourcePatternHints.java index 4a8a759f2d..280e1d8feb 100644 --- a/spring-core/src/main/java/org/springframework/aot/hint/ResourcePatternHints.java +++ b/spring-core/src/main/java/org/springframework/aot/hint/ResourcePatternHints.java @@ -72,7 +72,7 @@ public final class ResourcePatternHints { /** * Includes the resources matching the specified pattern. * @param reachableType the type that should be reachable for this hint to apply - * @param includes the include patterns + * @param includes the include patterns (see {@link ResourcePatternHint} documentation) * @return {@code this}, to facilitate method chaining */ public Builder includes(TypeReference reachableType, String... includes) { @@ -84,7 +84,7 @@ public final class ResourcePatternHints { /** * Includes the resources matching the specified pattern. - * @param includes the include patterns + * @param includes the include patterns (see {@link ResourcePatternHint} documentation) * @return {@code this}, to facilitate method chaining */ public Builder includes(String... includes) { @@ -94,7 +94,7 @@ public final class ResourcePatternHints { /** * Exclude resources matching the specified pattern. * @param reachableType the type that should be reachable for this hint to apply - * @param excludes the excludes pattern + * @param excludes the excludes pattern (see {@link ResourcePatternHint} documentation) * @return {@code this}, to facilitate method chaining */ public Builder excludes(TypeReference reachableType, String... excludes) { @@ -106,7 +106,7 @@ public final class ResourcePatternHints { /** * Exclude resources matching the specified pattern. - * @param excludes the excludes pattern + * @param excludes the excludes pattern (see {@link ResourcePatternHint} documentation) * @return {@code this}, to facilitate method chaining */ public Builder excludes(String... excludes) {