Skip to content

Commit b9f8562

Browse files
committed
Improve ResourcePatternHint documentation
Closes gh-28598
1 parent 99ffd97 commit b9f8562

File tree

3 files changed

+20
-6
lines changed

3 files changed

+20
-6
lines changed

spring-core/src/main/java/org/springframework/aot/hint/ResourceHints.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ public ResourceHints registerPattern(@Nullable Consumer<ResourcePatternHints.Bui
8383
/**
8484
* Register that the resources matching the specified pattern should be
8585
* made available at runtime.
86-
* @param include a pattern of the resources to include
86+
* @param include a pattern of the resources to include (see {@link ResourcePatternHint} documentation)
8787
* @return {@code this}, to facilitate method chaining
8888
*/
8989
public ResourceHints registerPattern(String include) {

spring-core/src/main/java/org/springframework/aot/hint/ResourcePatternHint.java

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,26 @@
2222

2323
/**
2424
* A hint that describes resources that should be made available at runtime.
25+
*
2526
* <p>The patterns may be a simple path which has a one-to-one mapping to a
2627
* resource on the classpath, or alternatively may contain the special
27-
* {@code *} character to indicate a wildcard search.
28+
* {@code *} character to indicate a wildcard search. For example:
29+
* <ul>
30+
* <li>{@code file.properties}: matches just the {@code file.properties}
31+
* file at the root of the classpath.</li>
32+
* <li>{@code com/example/file.properties}: matches just the
33+
* {@code file.properties} file in {@code com/example/}.</li>
34+
* <li>{@code *.properties}: matches all the files with a {@code .properties}
35+
* extension anywhere in the classpath.</li>
36+
* <li>{@code com/example/*.properties}: matches all the files with a {@code .properties}
37+
* extension in {@code com/example/} and its child directories at any depth.</li>
38+
* <li>{@code com/example/*}: matches all the files in {@code com/example/}
39+
* and its child directories at any depth.</li>
40+
* </ul>
2841
*
2942
* @author Stephane Nicoll
3043
* @author Brian Clozel
44+
* @author Sebastien Deleuze
3145
* @since 6.0
3246
*/
3347
public final class ResourcePatternHint implements ConditionalHint {

spring-core/src/main/java/org/springframework/aot/hint/ResourcePatternHints.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public static class Builder {
7272
/**
7373
* Includes the resources matching the specified pattern.
7474
* @param reachableType the type that should be reachable for this hint to apply
75-
* @param includes the include patterns
75+
* @param includes the include patterns (see {@link ResourcePatternHint} documentation)
7676
* @return {@code this}, to facilitate method chaining
7777
*/
7878
public Builder includes(TypeReference reachableType, String... includes) {
@@ -84,7 +84,7 @@ public Builder includes(TypeReference reachableType, String... includes) {
8484

8585
/**
8686
* Includes the resources matching the specified pattern.
87-
* @param includes the include patterns
87+
* @param includes the include patterns (see {@link ResourcePatternHint} documentation)
8888
* @return {@code this}, to facilitate method chaining
8989
*/
9090
public Builder includes(String... includes) {
@@ -94,7 +94,7 @@ public Builder includes(String... includes) {
9494
/**
9595
* Exclude resources matching the specified pattern.
9696
* @param reachableType the type that should be reachable for this hint to apply
97-
* @param excludes the excludes pattern
97+
* @param excludes the excludes pattern (see {@link ResourcePatternHint} documentation)
9898
* @return {@code this}, to facilitate method chaining
9999
*/
100100
public Builder excludes(TypeReference reachableType, String... excludes) {
@@ -106,7 +106,7 @@ public Builder excludes(TypeReference reachableType, String... excludes) {
106106

107107
/**
108108
* Exclude resources matching the specified pattern.
109-
* @param excludes the excludes pattern
109+
* @param excludes the excludes pattern (see {@link ResourcePatternHint} documentation)
110110
* @return {@code this}, to facilitate method chaining
111111
*/
112112
public Builder excludes(String... excludes) {

0 commit comments

Comments
 (0)