Package migratedb.v1.core.internal.util
Class LocationScanner<T>
java.lang.Object
migratedb.v1.core.internal.util.LocationScanner<T>
- All Implemented Interfaces:
ClassProvider<T>,ResourceProvider
(Almost) drop-in replacement for class path scanning stuff.
-
Constructor Summary
ConstructorsConstructorDescriptionLocationScanner(Class<T> supertype, Collection<Location> locations, ClassLoader classLoader, boolean failOnMissingLocations) -
Method Summary
Modifier and TypeMethodDescriptionCollection<Class<? extends T>>Retrieve all classes which implement the specified interface.@Nullable ResourcegetResource(String name) Retrieves the resource with this name.getResources(String prefix, Collection<String> suffixes) Retrieve all resources whose last name component begins with this prefix and ends with any of these suffixes.
-
Constructor Details
-
LocationScanner
public LocationScanner(Class<T> supertype, Collection<Location> locations, ClassLoader classLoader, boolean failOnMissingLocations)
-
-
Method Details
-
getClasses
Description copied from interface:ClassProviderRetrieve all classes which implement the specified interface.- Specified by:
getClassesin interfaceClassProvider<T>- Returns:
- The non-abstract classes that were found.
-
getResource
Description copied from interface:ResourceProviderRetrieves the resource with this name.- Specified by:
getResourcein interfaceResourceProvider- Parameters:
name- The name of the resource.- Returns:
- The resource or
nullif not found.
-
getResources
Description copied from interface:ResourceProviderRetrieve all resources whose last name component begins with this prefix and ends with any of these suffixes.- Specified by:
getResourcesin interfaceResourceProvider- Parameters:
prefix- The prefix.suffixes- The suffixes.- Returns:
- The matching resources.
-