Interface ClasspathScanner
-
@API(status=MAINTAINED, since="1.13.3") public interface ClasspathScannerClasspathScannerallows to scan the classpath for classes and resources.An implementation of this interface can be registered via the
ServiceLoadermechanism.- Since:
- 1.12
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description java.util.List<java.lang.Class<?>>scanForClassesInClasspathRoot(java.net.URI root, ClassFilter classFilter)Find all classes in the supplied classpathrootthat match the specifiedclassFilterfilter.java.util.List<java.lang.Class<?>>scanForClassesInPackage(java.lang.String basePackageName, ClassFilter classFilter)Find all classes in the supplied classpathrootthat match the specifiedclassFilterfilter.default java.util.List<Resource>scanForResourcesInClasspathRoot(java.net.URI root, java.util.function.Predicate<Resource> resourceFilter)Deprecated.Please implementscanForResourcesInClasspathRoot(URI, ResourceFilter)insteaddefault java.util.List<? extends Resource>scanForResourcesInClasspathRoot(java.net.URI root, ResourceFilter resourceFilter)Find all resources in the supplied classpathrootthat match the specifiedresourceFilterpredicate.default java.util.List<Resource>scanForResourcesInPackage(java.lang.String basePackageName, java.util.function.Predicate<Resource> resourceFilter)Deprecated.Please implementscanForResourcesInPackage(String, ResourceFilter)insteaddefault java.util.List<? extends Resource>scanForResourcesInPackage(java.lang.String basePackageName, ResourceFilter resourceFilter)Find all resources in the supplied classpathrootthat match the specifiedresourceFilterpredicate.
-
-
-
Method Detail
-
scanForClassesInPackage
java.util.List<java.lang.Class<?>> scanForClassesInPackage(java.lang.String basePackageName, ClassFilter classFilter)Find all classes in the supplied classpathrootthat match the specifiedclassFilterfilter.The classpath scanning algorithm searches recursively in subpackages beginning with the root of the classpath.
- Parameters:
basePackageName- the name of the base package in which to start scanning; must not benulland must be valid in terms of Java syntaxclassFilter- the class type filter; nevernull- Returns:
- a list of all such classes found; never
nullbut potentially empty
-
scanForClassesInClasspathRoot
java.util.List<java.lang.Class<?>> scanForClassesInClasspathRoot(java.net.URI root, ClassFilter classFilter)Find all classes in the supplied classpathrootthat match the specifiedclassFilterfilter.The classpath scanning algorithm searches recursively in subpackages beginning with the root of the classpath.
- Parameters:
root- the URI for the classpath root in which to scan; nevernullclassFilter- the class type filter; nevernull- Returns:
- a list of all such classes found; never
nullbut potentially empty
-
scanForResourcesInPackage
@API(status=DEPRECATED, since="1.14") @Deprecated default java.util.List<Resource> scanForResourcesInPackage(java.lang.String basePackageName, java.util.function.Predicate<Resource> resourceFilter)Deprecated.Please implementscanForResourcesInPackage(String, ResourceFilter)insteadFind all resources in the supplied classpathrootthat match the specifiedresourceFilterpredicate.The classpath scanning algorithm searches recursively in subpackages beginning with the root of the classpath.
- Parameters:
basePackageName- the name of the base package in which to start scanning; must not benulland must be valid in terms of Java syntaxresourceFilter- the resource type filter; nevernull- Returns:
- a list of all such resources found; never
nullbut potentially empty
-
scanForResourcesInClasspathRoot
@API(status=DEPRECATED, since="1.14") @Deprecated default java.util.List<Resource> scanForResourcesInClasspathRoot(java.net.URI root, java.util.function.Predicate<Resource> resourceFilter)Deprecated.Please implementscanForResourcesInClasspathRoot(URI, ResourceFilter)insteadFind all resources in the supplied classpathrootthat match the specifiedresourceFilterpredicate.The classpath scanning algorithm searches recursively in subpackages beginning with the root of the classpath.
- Parameters:
root- the URI for the classpath root in which to scan; nevernullresourceFilter- the resource type filter; nevernull- Returns:
- a list of all such resources found; never
nullbut potentially empty
-
scanForResourcesInPackage
@API(status=MAINTAINED, since="1.14") default java.util.List<? extends Resource> scanForResourcesInPackage(java.lang.String basePackageName, ResourceFilter resourceFilter)Find all resources in the supplied classpathrootthat match the specifiedresourceFilterpredicate.The classpath scanning algorithm searches recursively in subpackages beginning with the root of the classpath.
- Parameters:
basePackageName- the name of the base package in which to start scanning; must not benulland must be valid in terms of Java syntaxresourceFilter- the resource type filter; nevernull- Returns:
- a list of all such resources found; never
nullbut potentially empty - Since:
- 1.14
-
scanForResourcesInClasspathRoot
@API(status=MAINTAINED, since="1.14") default java.util.List<? extends Resource> scanForResourcesInClasspathRoot(java.net.URI root, ResourceFilter resourceFilter)Find all resources in the supplied classpathrootthat match the specifiedresourceFilterpredicate.The classpath scanning algorithm searches recursively in subpackages beginning with the root of the classpath.
- Parameters:
root- the URI for the classpath root in which to scan; nevernullresourceFilter- the resource type filter; nevernull- Returns:
- a list of all such resources found; never
nullbut potentially empty - Since:
- 1.14
-
-