Top Description Methods
org.junit.platform.commons.support.scanning

public Interface ClasspathScanner

Known Direct Implementers
org.junit.platform.commons.util.DefaultClasspathScanner
Annotations
@API
status:MAINTAINED
since:1.13.3
Static Imports
org.apiguardian.api.API.Status.DEPRECATED, .API.Status.MAINTAINED

ClasspathScanner allows to scan the classpath for classes and resources.

An implementation of this interface can be registered via the ServiceLoader mechanism.

Since
1.12

Method Summary

Modifier and TypeMethod and Description
public List<Class<?>>

Returns:

a list of all such classes found; never null but potentially empty
scanForClassesInClasspathRoot
(URI
the URI for the classpath root in which to scan; never null
root
,
ClassFilter
the class type filter; never null
classFilter
)

Find all classes in the supplied classpath root that match the specified classFilter filter.

public List<Class<?>>

Returns:

a list of all such classes found; never null but potentially empty
scanForClassesInPackage
(String
the name of the base package in which to start scanning; must not be null and must be valid in terms of Java syntax
basePackageName
,
ClassFilter
the class type filter; never null
classFilter
)

Find all classes in the supplied classpath root that match the specified classFilter filter.

public default List<Resource>

Returns:

a list of all such resources found; never null but potentially empty
scanForResourcesInClasspathRoot
(URI
the URI for the classpath root in which to scan; never null
root
,
Predicate<Resource>
the resource type filter; never null
resourceFilter
)
Deprecated for removal since 1.14. Please implement scanForResourcesInClasspathRoot(URI, ResourceFilter) instead

Find all resources in the supplied classpath root that match the specified resourceFilter predicate.

public default List<? extends Resource>

Returns:

a list of all such resources found; never null but potentially empty
scanForResourcesInClasspathRoot
(URI
the URI for the classpath root in which to scan; never null
root
,
ResourceFilter
the resource type filter; never null
resourceFilter
)

Find all resources in the supplied classpath root that match the specified resourceFilter predicate.

public default List<Resource>

Returns:

a list of all such resources found; never null but potentially empty
scanForResourcesInPackage
(String
the name of the base package in which to start scanning; must not be null and must be valid in terms of Java syntax
basePackageName
,
Predicate<Resource>
the resource type filter; never null
resourceFilter
)
Deprecated for removal since 1.14. Please implement scanForResourcesInPackage(String, ResourceFilter) instead

Find all resources in the supplied classpath root that match the specified resourceFilter predicate.

public default List<? extends Resource>

Returns:

a list of all such resources found; never null but potentially empty
scanForResourcesInPackage
(String
the name of the base package in which to start scanning; must not be null and must be valid in terms of Java syntax
basePackageName
,
ResourceFilter
the resource type filter; never null
resourceFilter
)

Find all resources in the supplied classpath root that match the specified resourceFilter predicate.

Method Detail

scanForClassesInClasspathRootback to summary
public List<Class<?>> scanForClassesInClasspathRoot(URI root, ClassFilter classFilter)

Find all classes in the supplied classpath root that match the specified classFilter filter.

The classpath scanning algorithm searches recursively in subpackages beginning with the root of the classpath.

Parameters
root:URI

the URI for the classpath root in which to scan; never null

classFilter:ClassFilter

the class type filter; never null

Returns:List<Class<?>>

a list of all such classes found; never null but potentially empty

scanForClassesInPackageback to summary
public List<Class<?>> scanForClassesInPackage(String basePackageName, ClassFilter classFilter)

Find all classes in the supplied classpath root that match the specified classFilter filter.

The classpath scanning algorithm searches recursively in subpackages beginning with the root of the classpath.

Parameters
basePackageName:String

the name of the base package in which to start scanning; must not be null and must be valid in terms of Java syntax

classFilter:ClassFilter

the class type filter; never null

Returns:List<Class<?>>

a list of all such classes found; never null but potentially empty

scanForResourcesInClasspathRootback to summary
public default List<Resource> scanForResourcesInClasspathRoot(URI root, Predicate<Resource> resourceFilter)

Deprecated

for removal since 1.14.

Please implement scanForResourcesInClasspathRoot(URI, ResourceFilter) instead

Find all resources in the supplied classpath root that match the specified resourceFilter predicate.

The classpath scanning algorithm searches recursively in subpackages beginning with the root of the classpath.

Parameters
root:URI

the URI for the classpath root in which to scan; never null

resourceFilter:Predicate<Resource>

the resource type filter; never null

Returns:List<Resource>

a list of all such resources found; never null but potentially empty

Annotations
@API
status:DEPRECATED
since:1.14
@Deprecated
since:1.14
forRemoval:true
@SuppressWarnings:removal
scanForResourcesInClasspathRootback to summary
public default List<? extends Resource> scanForResourcesInClasspathRoot(URI root, ResourceFilter resourceFilter)

Find all resources in the supplied classpath root that match the specified resourceFilter predicate.

The classpath scanning algorithm searches recursively in subpackages beginning with the root of the classpath.

Parameters
root:URI

the URI for the classpath root in which to scan; never null

resourceFilter:ResourceFilter

the resource type filter; never null

Returns:List<? extends Resource>

a list of all such resources found; never null but potentially empty

Annotations
@API
status:MAINTAINED
since:1.14
@SuppressWarnings:removal
Since
1.14
scanForResourcesInPackageback to summary
public default List<Resource> scanForResourcesInPackage(String basePackageName, Predicate<Resource> resourceFilter)

Deprecated

for removal since 1.14.

Please implement scanForResourcesInPackage(String, ResourceFilter) instead

Find all resources in the supplied classpath root that match the specified resourceFilter predicate.

The classpath scanning algorithm searches recursively in subpackages beginning with the root of the classpath.

Parameters
basePackageName:String

the name of the base package in which to start scanning; must not be null and must be valid in terms of Java syntax

resourceFilter:Predicate<Resource>

the resource type filter; never null

Returns:List<Resource>

a list of all such resources found; never null but potentially empty

Annotations
@API
status:DEPRECATED
since:1.14
@Deprecated
since:1.14
forRemoval:true
@SuppressWarnings:removal, unused
scanForResourcesInPackageback to summary
public default List<? extends Resource> scanForResourcesInPackage(String basePackageName, ResourceFilter resourceFilter)

Find all resources in the supplied classpath root that match the specified resourceFilter predicate.

The classpath scanning algorithm searches recursively in subpackages beginning with the root of the classpath.

Parameters
basePackageName:String

the name of the base package in which to start scanning; must not be null and must be valid in terms of Java syntax

resourceFilter:ResourceFilter

the resource type filter; never null

Returns:List<? extends Resource>

a list of all such resources found; never null but potentially empty

Annotations
@API
status:MAINTAINED
since:1.14
@SuppressWarnings:removal
Since
1.14