final class ExtensionUtils
extends java.lang.Object
ExtensionRegistrar,
MutableExtensionRegistry,
ExtendWith,
RegisterExtension| Modifier and Type | Field and Description |
|---|---|
private static java.util.Comparator<java.lang.reflect.Field> |
orderComparator |
| Modifier | Constructor and Description |
|---|---|
private |
ExtensionUtils() |
| Modifier and Type | Method and Description |
|---|---|
private static int |
getOrder(java.lang.reflect.Field field) |
(package private) static MutableExtensionRegistry |
populateNewExtensionRegistryFromExtendWithAnnotation(MutableExtensionRegistry parentRegistry,
java.lang.reflect.AnnotatedElement annotatedElement)
Populate a new
MutableExtensionRegistry from extension types declared via
@ExtendWith on the supplied AnnotatedElement. |
(package private) static void |
registerExtensionsFromFields(ExtensionRegistrar registrar,
java.lang.Class<?> clazz,
java.lang.Object instance)
Register extensions in the supplied registry from fields in the supplied
class that are annotated with
@RegisterExtension. |
private static final java.util.Comparator<java.lang.reflect.Field> orderComparator
static MutableExtensionRegistry populateNewExtensionRegistryFromExtendWithAnnotation(MutableExtensionRegistry parentRegistry, java.lang.reflect.AnnotatedElement annotatedElement)
MutableExtensionRegistry from extension types declared via
@ExtendWith on the supplied AnnotatedElement.parentRegistry - the parent extension registry to set in the newly
created registry; never nullannotatedElement - the annotated element on which to search for
declarations of @ExtendWith; never nullnullstatic void registerExtensionsFromFields(ExtensionRegistrar registrar, java.lang.Class<?> clazz, java.lang.Object instance)
@RegisterExtension.
The extensions will be sorted according to @Order semantics
prior to registration.
registrar - the registrar with which to register the extensions; never nullclazz - the class or interface in which to find the fields; never nullinstance - the instance of the supplied class; may be null
when searching for static fields in the classprivate static int getOrder(java.lang.reflect.Field field)