@API(status=INTERNAL,
since="5.5")
public interface ExtensionRegistrar
ExtensionRegistrar is used to register extensions.| Modifier and Type | Method and Description |
|---|---|
void |
registerExtension(java.lang.Class<? extends Extension> extensionType)
Instantiate an extension of the given type using its default constructor
and register it in the registry.
|
void |
registerExtension(Extension extension,
java.lang.Object source)
Register the supplied
Extension, without checking if an extension
of that type has already been registered. |
void |
registerSyntheticExtension(Extension extension,
java.lang.Object source)
Register the supplied
Extension as a synthetic extension,
without checking if an extension of that type has already been registered. |
void registerExtension(java.lang.Class<? extends Extension> extensionType)
A new Extension should not be registered if an extension of the
given type already exists in the registry or a parent registry.
extensionType - the type of extension to registervoid registerExtension(Extension extension, java.lang.Object source)
Extension, without checking if an extension
of that type has already been registered.
If an extension is registered declaratively via
@ExtendWith, the
source and the extension should be the same object.
However, if an extension is registered programmatically via
@RegisterExtension,
the source object should be the Field
that is annotated with @RegisterExtension. Similarly, if an
extension is registered programmatically as a lambda expression
or method reference, the source object should be the underlying
Method that implements the extension API.
extension - the extension to register; never nullsource - the source of the extension; never nullvoid registerSyntheticExtension(Extension extension, java.lang.Object source)
Extension as a synthetic extension,
without checking if an extension of that type has already been registered.extension - the extension to register; never nullsource - the source of the extension; never nullregisterExtension(Extension, Object)