Interface ExtensionRegistrar

  • All Known Implementing Classes:
    MutableExtensionRegistry

    @API(status=INTERNAL,
         since="5.5")
    public interface ExtensionRegistrar
    An ExtensionRegistrar is used to register extension.
    Since:
    5.5
    • Method Detail

      • registerExtension

        void registerExtension​(Extension extension,
                               java.lang.Object source)
        Register the supplied Extension, without checking if an extension of that type already exists.

        Semantics for Source

        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.

        Parameters:
        extension - the extension to register; never null
        source - the source of the extension; never null