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 |
registerExtensionsFromConstructorParameters(ExtensionRegistrar registrar,
java.lang.Class<?> clazz)
Register extensions using the supplied registrar from parameters in the
declared constructor of the supplied class that are annotated with
@ExtendWith. |
(package private) static void |
registerExtensionsFromExecutableParameters(ExtensionRegistrar registrar,
java.lang.reflect.Executable executable)
Register extensions using the supplied registrar from parameters in the
supplied
Executable (i.e., a Constructor
or Method) that are annotated with
@ExtendWith. |
(package private) static void |
registerExtensionsFromFields(ExtensionRegistrar registrar,
java.lang.Class<?> clazz,
java.lang.Object instance)
Register extensions using the supplied registrar from fields in the supplied
class that are annotated with
@ExtendWith or
@RegisterExtension. |
private static java.util.stream.Stream<java.lang.Class<? extends Extension>> |
streamExtensionTypes(java.lang.reflect.AnnotatedElement annotatedElement) |
private static java.util.stream.Stream<java.lang.Class<? extends Extension>> |
streamExtensionTypes(java.util.List<ExtendWith> extendWithAnnotations) |
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)
@ExtendWith or
@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 classstatic void registerExtensionsFromConstructorParameters(ExtensionRegistrar registrar, java.lang.Class<?> clazz)
@ExtendWith.registrar - the registrar with which to register the extensions; never nullclazz - the class in which to find the declared constructor; never nullstatic void registerExtensionsFromExecutableParameters(ExtensionRegistrar registrar, java.lang.reflect.Executable executable)
Executable (i.e., a Constructor
or Method) that are annotated with
@ExtendWith.registrar - the registrar with which to register the extensions; never nullexecutable - the constructor or method whose parameters should be searched; never nullprivate static java.util.stream.Stream<java.lang.Class<? extends Extension>> streamExtensionTypes(java.lang.reflect.AnnotatedElement annotatedElement)
private static java.util.stream.Stream<java.lang.Class<? extends Extension>> streamExtensionTypes(java.util.List<ExtendWith> extendWithAnnotations)
private static int getOrder(java.lang.reflect.Field field)