@API(status=INTERNAL, since="1.1") public class ModuleUtils extends java.lang.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!
Modifier and Type | Field | Description |
---|---|---|
static java.lang.String |
VERSION |
Version hint is set to
"base" here. |
Constructor | Description |
---|---|
ModuleUtils() |
Modifier and Type | Method | Description |
---|---|---|
static java.util.List<java.lang.Class<?>> |
findAllClassesInModule(java.lang.String moduleName,
ClassFilter filter) |
Find all classes for the given module name.
|
static java.util.Set<java.lang.String> |
findAllNonSystemBootModuleNames() |
Find all non-system boot modules names.
|
static java.util.Optional<java.lang.String> |
getModuleName(java.lang.Class<?> type) |
Return the name of the module that the class or interface is a member of.
|
static java.util.Optional<java.lang.String> |
getModuleVersion(java.lang.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 final java.lang.String VERSION
"base"
here.public static java.util.Set<java.lang.String> findAllNonSystemBootModuleNames()
null
but
potentially emptypublic static boolean isJavaPlatformModuleSystemAvailable()
true
if the Java Platform Module System is available,
otherwise false
public static java.util.Optional<java.lang.String> getModuleName(java.lang.Class<?> type)
type
- class or interface to analyzenull
but potentially emptypublic static java.util.Optional<java.lang.String> getModuleVersion(java.lang.Class<?> type)
type
- class or interface to analyzenull
but potentially emptypublic static java.util.List<java.lang.Class<?>> findAllClassesInModule(java.lang.String moduleName, ClassFilter filter)
moduleName
- name of the module to scanfilter
- class filter to applynull
but potentially empty