Class LocationScanner<T>

java.lang.Object
migratedb.v1.core.internal.util.LocationScanner<T>
All Implemented Interfaces:
ClassProvider<T>, ResourceProvider

public final class LocationScanner<T> extends Object implements ClassProvider<T>, ResourceProvider
(Almost) drop-in replacement for class path scanning stuff.
  • Constructor Details

  • Method Details

    • getClasses

      public Collection<Class<? extends T>> getClasses()
      Description copied from interface: ClassProvider
      Retrieve all classes which implement the specified interface.
      Specified by:
      getClasses in interface ClassProvider<T>
      Returns:
      The non-abstract classes that were found.
    • getResource

      public @Nullable Resource getResource(String name)
      Description copied from interface: ResourceProvider
      Retrieves the resource with this name.
      Specified by:
      getResource in interface ResourceProvider
      Parameters:
      name - The name of the resource.
      Returns:
      The resource or null if not found.
    • getResources

      public Collection<Resource> getResources(String prefix, Collection<String> suffixes)
      Description copied from interface: ResourceProvider
      Retrieve all resources whose last name component begins with this prefix and ends with any of these suffixes.
      Specified by:
      getResources in interface ResourceProvider
      Parameters:
      prefix - The prefix.
      suffixes - The suffixes.
      Returns:
      The matching resources.