Improve ResourcePatternHint documentation

Closes gh-28598
This commit is contained in:
Sébastien Deleuze 2022-06-09 14:38:10 +02:00
parent 99ffd97a72
commit b9f85627a1
3 changed files with 20 additions and 6 deletions

View File

@ -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) {

View File

@ -22,12 +22,26 @@ import org.springframework.lang.Nullable;
/**
* A hint that describes resources that should be made available at runtime.
*
* <p>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:
* <ul>
* <li>{@code file.properties}: matches just the {@code file.properties}
* file at the root of the classpath.</li>
* <li>{@code com/example/file.properties}: matches just the
* {@code file.properties} file in {@code com/example/}.</li>
* <li>{@code *.properties}: matches all the files with a {@code .properties}
* extension anywhere in the classpath.</li>
* <li>{@code com/example/*.properties}: matches all the files with a {@code .properties}
* extension in {@code com/example/} and its child directories at any depth.</li>
* <li>{@code com/example/*}: matches all the files in {@code com/example/}
* and its child directories at any depth.</li>
* </ul>
*
* @author Stephane Nicoll
* @author Brian Clozel
* @author Sebastien Deleuze
* @since 6.0
*/
public final class ResourcePatternHint implements ConditionalHint {

View File

@ -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) {