@API(status=INTERNAL, since="1.1") public class ModuleUtils extends Object
java.lang.Module
and friends.
These utilities are intended solely for usage within the JUnit framework itself. Any usage by external parties is not supported. Use at your own risk!
Constructor | Description |
---|---|
ModuleUtils() |
Modifier and Type | Method | Description |
---|---|---|
static List<Class<?>> |
findAllClassesInModule(String moduleName,
ClassFilter filter) |
Find all classes for the given module name.
|
static Set<String> |
findAllNonSystemBootModuleNames() |
Find all non-system boot modules names.
|
static Optional<String> |
getModuleName(Class<?> type) |
Return the name of the module that the class or interface is a member of.
|
static Optional<String> |
getModuleVersion(Class<?> type) |
Return the raw version of the module that the class or interface is a member of.
|
static boolean |
isJavaPlatformModuleSystemAvailable() |
Determine if the current Java runtime supports the Java Platform Module System.
|
public static Set<String> findAllNonSystemBootModuleNames()
null
but
potentially emptypublic static boolean isJavaPlatformModuleSystemAvailable()
true
if the Java Platform Module System is available,
otherwise false
public static Optional<String> getModuleName(Class<?> type)
type
- class or interface to analyzenull
but potentially emptypublic static Optional<String> getModuleVersion(Class<?> type)
type
- class or interface to analyzenull
but potentially emptypublic static List<Class<?>> findAllClassesInModule(String moduleName, ClassFilter filter)
moduleName
- the name of the module to scan; never null
or
emptyfilter
- the class filter to apply; never null
null
but potentially emptyCopyright © 2019. All rights reserved.