Package org.springframework.aot.hint.support

# Class FilePatternResourceHintsRegistrar.Builder

java.lang.Object
org.springframework.aot.hint.support.FilePatternResourceHintsRegistrar.Builder

Enclosing class:
  FilePatternResourceHintsRegistrar

public static final class FilePatternResourceHintsRegistrar.Builder extends Object
Builder for `FilePatternResourceHintsRegistrar`.

Since:
  6.0.12

## Method Summary

Modifier and Type
Method
Description
`void`
`registerHints(ResourceHints hints, ClassLoader classLoader)`
Register resource hints for the current state of this builder.
`FilePatternResourceHintsRegistrar.Builder`
`withClasspathLocations(String... classpathLocations)`
Consider the specified classpath locations.
`FilePatternResourceHintsRegistrar.Builder`
`withClasspathLocations(List<String> classpathLocations)`
Consider the specified classpath locations.
`FilePatternResourceHintsRegistrar.Builder`
`withFileExtensions(String... fileExtensions)`
Consider the specified file extensions.
`FilePatternResourceHintsRegistrar.Builder`
`withFileExtensions(List<String> fileExtensions)`
Consider the specified file extensions.
`FilePatternResourceHintsRegistrar.Builder`
`withFilePrefixes(String... filePrefixes)`
Consider the specified file prefixes.
`FilePatternResourceHintsRegistrar.Builder`
`withFilePrefixes(List<String> filePrefixes)`
Consider the specified file prefixes.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Method Details

### withClasspathLocations

public FilePatternResourceHintsRegistrar.Builder withClasspathLocations(String... classpathLocations)
Consider the specified classpath locations.

A location can either be a special "classpath:" pseudo location or a standard location, such as `com/example/resources`. An empty String represents the root of the classpath.

Parameters:
  `classpathLocations` - the classpath locations to consider
Returns:
  this builder
See Also:
  - `withClasspathLocations(List)`

### withClasspathLocations

public FilePatternResourceHintsRegistrar.Builder withClasspathLocations(List<String> classpathLocations)
Consider the specified classpath locations.

A location can either be a special "classpath:" pseudo location or a standard location, such as `com/example/resources`. An empty String represents the root of the classpath.

Parameters:
  `classpathLocations` - the classpath locations to consider
Returns:
  this builder
See Also:
  - `withClasspathLocations(String...)`

### withFilePrefixes

public FilePatternResourceHintsRegistrar.Builder withFilePrefixes(String... filePrefixes)
Consider the specified file prefixes. Any file whose name starts with one of the specified prefixes is considered. A prefix cannot contain the `*` character.

Parameters:
  `filePrefixes` - the file prefixes to consider
Returns:
  this builder
See Also:
  - `withFilePrefixes(List)`

### withFilePrefixes

public FilePatternResourceHintsRegistrar.Builder withFilePrefixes(List<String> filePrefixes)
Consider the specified file prefixes. Any file whose name starts with one of the specified prefixes is considered. A prefix cannot contain the `*` character.

Parameters:
  `filePrefixes` - the file prefixes to consider
Returns:
  this builder
See Also:
  - `withFilePrefixes(String...)`

### withFileExtensions

public FilePatternResourceHintsRegistrar.Builder withFileExtensions(String... fileExtensions)
Consider the specified file extensions. A file extension must start with a `.` character.

Parameters:
  `fileExtensions` - the file extensions to consider
Returns:
  this builder
See Also:
  - `withFileExtensions(List)`

### withFileExtensions

public FilePatternResourceHintsRegistrar.Builder withFileExtensions(List<String> fileExtensions)
Consider the specified file extensions. A file extension must start with a `.` character.

Parameters:
  `fileExtensions` - the file extensions to consider
Returns:
  this builder
See Also:
  - `withFileExtensions(String...)`

### registerHints

public void registerHints(ResourceHints hints, @Nullable ClassLoader classLoader)
Register resource hints for the current state of this builder. For each classpath location that resolves against the `ClassLoader`, files with the configured file prefixes and extensions are registered.

Parameters:
  `hints` - the hints contributed so far for the deployment unit
  `classLoader` - the ClassLoader to use, or `null` for the default