Interface Provider<T>

Type Parameters:
T - the type of component this provider creates
All Known Subinterfaces:
FileReviewerProvider, PrintFormatProvider<T>
All Known Implementing Classes:
AutomaticFileReviewer, MultiLineStringPrintFormat, NoneFileReviewer, SingleLineStringPrintFormat

@NullMarked public interface Provider<T>
Service Provider Interface (SPI) for registering configurable components.

Implementations of this interface can be registered via META-INF/services/org.approvej.configuration.Provider and will be automatically discovered by the Registry.

This interface is typically implemented directly by the component class itself, allowing the component to serve as its own provider. Use specialized sub-interfaces like PrintFormatProvider or FileReviewerProvider which provide a default implementation for type().

  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the alias that can be used to reference this provider in configuration.
    Creates a new instance of the component.
    Class<? super T>
    Returns the type of component this provider creates.
  • Method Details

    • alias

      String alias()
      Returns the alias that can be used to reference this provider in configuration.

      For example, "json" or "yaml" for print formats, or "none" or "automatic" for reviewers.

      Returns:
      the alias for this provider
    • create

      T create()
      Creates a new instance of the component.

      When implemented by the component class itself, this typically returns a new instance of the same class via its no-argument constructor.

      Returns:
      a new instance of the component
    • type

      Class<? super T> type()
      Returns the type of component this provider creates.

      Specialized sub-interfaces like PrintFormatProvider and FileReviewerProvider provide default implementations for this method.

      Returns:
      the component type class