Top Description Inners Fields Constructors Methods
org.springframework.aot.hint

public final Class ResourcePatternHints

extends Object
Class Inheritance
Imports
java.util.ArrayList, .Arrays, .LinkedHashSet, .List, .Set, org.springframework.lang.Nullable

A collection of ResourcePatternHint describing whether resources should be made available at runtime using a matching algorithm based on include/exclude patterns.
Authors
Stephane Nicoll, Brian Clozel, Sam Brannen
Since
6.0

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class

Field Summary

Modifier and TypeField and Description
private final List<ResourcePatternHint>
private final List<ResourcePatternHint>

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public List<ResourcePatternHint>

Returns:

the exclude patterns
getExcludes
()

Return the exclude patterns to use to identify the resources to match.

public List<ResourcePatternHint>

Returns:

the include patterns
getIncludes
()

Return the include patterns to use to identify the resources to match.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

excludesback to summary
private final List<ResourcePatternHint> excludes
includesback to summary
private final List<ResourcePatternHint> includes

Constructor Detail

ResourcePatternHintsback to summary
private ResourcePatternHints(ResourcePatternHints.Builder builder)

Method Detail

getExcludesback to summary
public List<ResourcePatternHint> getExcludes()

Return the exclude patterns to use to identify the resources to match.

Returns:List<ResourcePatternHint>

the exclude patterns

getIncludesback to summary
public List<ResourcePatternHint> getIncludes()

Return the include patterns to use to identify the resources to match.

Returns:List<ResourcePatternHint>

the include patterns

org.springframework.aot.hint back to summary

public Class ResourcePatternHints.Builder

extends Object
Class Inheritance

Builder for ResourcePatternHints.

Field Summary

Modifier and TypeField and Description
private final Set<ResourcePatternHint>
private final Set<ResourcePatternHint>

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
pack-priv ResourcePatternHints

Returns:

resource pattern hints
build
()

Create ResourcePatternHints based on the state of this builder.

public ResourcePatternHints.Builder

Returns:

this, to facilitate method chaining
excludes
(TypeReference
the type that should be reachable for this hint to apply
reachableType
,
String...
the exclude patterns (see ResourcePatternHint documentation)
excludes
)

Exclude resources matching the specified patterns.

public ResourcePatternHints.Builder

Returns:

this, to facilitate method chaining
excludes
(String...
the exclude patterns (see ResourcePatternHint documentation)
excludes
)

Exclude resources matching the specified patterns.

private List<String>
expandToIncludeDirectories(String includePattern)

Expand the supplied include pattern into multiple patterns that include all parent directories for the ultimate resource or resources.

public ResourcePatternHints.Builder

Returns:

this, to facilitate method chaining
includes
(TypeReference
the type that should be reachable for this hint to apply
reachableType
,
String...
the include patterns (see ResourcePatternHint documentation)
includes
)

Include resources matching the specified patterns.

public ResourcePatternHints.Builder

Returns:

this, to facilitate method chaining
includes
(String...
the include patterns (see ResourcePatternHint documentation)
includes
)

Include resources matching the specified patterns.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

excludesback to summary
private final Set<ResourcePatternHint> excludes
includesback to summary
private final Set<ResourcePatternHint> includes

Constructor Detail

Builderback to summary
pack-priv Builder()

Method Detail

buildback to summary
pack-priv ResourcePatternHints build()

Create ResourcePatternHints based on the state of this builder.

Returns:ResourcePatternHints

resource pattern hints

excludesback to summary
public ResourcePatternHints.Builder excludes(TypeReference reachableType, String... excludes)

Exclude resources matching the specified patterns.

Parameters
reachableType:TypeReference

the type that should be reachable for this hint to apply

excludes:String[]

the exclude patterns (see ResourcePatternHint documentation)

Returns:ResourcePatternHints.Builder

this, to facilitate method chaining

excludesback to summary
public ResourcePatternHints.Builder excludes(String... excludes)

Exclude resources matching the specified patterns.

Parameters
excludes:String[]

the exclude patterns (see ResourcePatternHint documentation)

Returns:ResourcePatternHints.Builder

this, to facilitate method chaining

expandToIncludeDirectoriesback to summary
private List<String> expandToIncludeDirectories(String includePattern)

Expand the supplied include pattern into multiple patterns that include all parent directories for the ultimate resource or resources.

This is necessary to support classpath scanning within a GraalVM native image.

See Also
gh-29403
includesback to summary
public ResourcePatternHints.Builder includes(TypeReference reachableType, String... includes)

Include resources matching the specified patterns.

Parameters
reachableType:TypeReference

the type that should be reachable for this hint to apply

includes:String[]

the include patterns (see ResourcePatternHint documentation)

Returns:ResourcePatternHints.Builder

this, to facilitate method chaining

includesback to summary
public ResourcePatternHints.Builder includes(String... includes)

Include resources matching the specified patterns.

Parameters
includes:String[]

the include patterns (see ResourcePatternHint documentation)

Returns:ResourcePatternHints.Builder

this, to facilitate method chaining