Package org.springframework.aot.hint
Class ResourceHints
java.lang.Object
org.springframework.aot.hint.ResourceHints
Gather the need for resources available at runtime.
- Since:
- 6.0
- Author:
- Stephane Nicoll, Sam Brannen
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionregisterPattern(String include) Register that the resources matching the specified pattern should be made available at runtime.registerPattern(Consumer<ResourcePatternHints.Builder> resourceHint) Register that the resources matching the specified pattern should be made available at runtime.registerPatternIfPresent(ClassLoader classLoader, String location, Consumer<ResourcePatternHints.Builder> resourceHint) Register a pattern if the givenlocationis available on the classpath.voidregisterResource(Resource resource) Register that the supplied resource should be made available at runtime.registerResourceBundle(String baseName) Register that the resource bundle with the specified base name should be made available at runtime.registerResourceBundle(String baseName, Consumer<ResourceBundleHint.Builder> resourceHint) Register that the resource bundle with the specified base name should be made available at runtime.registerType(Class<?> type) Register that the bytecode of the specified type should be made available at runtime.registerType(TypeReference type) Register that the bytecode of the type defined by the specifiedTypeReferenceshould be made available at runtime.Return the resource bundles that should be made available at runtime.Return the resources that should be made available at runtime.
- 
Constructor Details- 
ResourceHintspublic ResourceHints()
 
- 
- 
Method Details- 
resourcePatternHintsReturn the resources that should be made available at runtime.- Returns:
- a stream of ResourcePatternHints
 
- 
resourceBundleHintsReturn the resource bundles that should be made available at runtime.- Returns:
- a stream of ResourceBundleHint
 
- 
registerPatternIfPresentpublic ResourceHints registerPatternIfPresent(@Nullable ClassLoader classLoader, String location, Consumer<ResourcePatternHints.Builder> resourceHint) Register a pattern if the givenlocationis available on the classpath. This delegates toClassLoader.getResource(String)which validates directories as well. The location is not included in the hint.- Parameters:
- classLoader- the classloader to use
- location- a '/'-separated path name that should exist
- resourceHint- a builder to customize the resource pattern
- Returns:
- this, to facilitate method chaining
 
- 
registerPatternRegister that the resources matching the specified pattern should be made available at runtime.- Parameters:
- resourceHint- a builder to further customize the resource pattern
- Returns:
- this, to facilitate method chaining
 
- 
registerPatternRegister that the resources matching the specified pattern should be made available at runtime.- Parameters:
- include- a pattern of the resources to include (see- ResourcePatternHintdocumentation)
- Returns:
- this, to facilitate method chaining
 
- 
registerResourceRegister that the supplied resource should be made available at runtime.- Parameters:
- resource- the resource to register
- Throws:
- IllegalArgumentException- if the supplied resource is not a- ClassPathResourceor does not exist
- See Also:
 
- 
registerTypeRegister that the bytecode of the type defined by the specifiedTypeReferenceshould be made available at runtime.- Parameters:
- type- the type to include
- Returns:
- this, to facilitate method chaining
 
- 
registerTypeRegister that the bytecode of the specified type should be made available at runtime.- Parameters:
- type- the type to include
- Returns:
- this, to facilitate method chaining
 
- 
registerResourceBundlepublic ResourceHints registerResourceBundle(String baseName, @Nullable Consumer<ResourceBundleHint.Builder> resourceHint) Register that the resource bundle with the specified base name should be made available at runtime.- Parameters:
- baseName- the base name of the resource bundle
- resourceHint- a builder to further customize the resource bundle
- Returns:
- this, to facilitate method chaining
 
- 
registerResourceBundleRegister that the resource bundle with the specified base name should be made available at runtime.- Parameters:
- baseName- the base name of the resource bundle
- Returns:
- this, to facilitate method chaining
 
 
-