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 null
annotatedElement
- the annotated element on which to search for
declarations of @ExtendWith
; never null
null
static 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 null
clazz
- the class or interface in which to find the fields; never null
instance
- 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)