Class ResourcePatternHint

java.lang.Object
org.springframework.aot.hint.ResourcePatternHint
All Implemented Interfaces:
ConditionalHint

public final class ResourcePatternHint extends Object implements ConditionalHint
A hint that describes resources that should be made available at runtime.

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 * character to indicate a wildcard search. For example:

  • file.properties: matches just the file.properties file at the root of the classpath.
  • com/example/file.properties: matches just the file.properties file in com/example/.
  • *.properties: matches all the files with a .properties extension anywhere in the classpath.
  • com/example/*.properties: matches all the files with a .properties extension in com/example/ and its child directories at any depth.
  • com/example/*: matches all the files in com/example/ and its child directories at any depth.
Since:
6.0
Author:
Stephane Nicoll, Brian Clozel, Sebastien Deleuze
  • Method Details

    • getPattern

      public String getPattern()
      Return the pattern to use for identifying the resources to match.
      Returns:
      the pattern
    • toRegex

      public Pattern toRegex()
      Return the regex Pattern to use for identifying the resources to match.
      Returns:
      the regex pattern
    • getReachableType

      @Nullable public TypeReference getReachableType()
      Description copied from interface: ConditionalHint
      Return the type that should be reachable for this hint to apply, or null if this hint should always been applied.
      Specified by:
      getReachableType in interface ConditionalHint
      Returns:
      the reachable type, if any
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object