Package nbbrd.service

Annotation Type ServiceProvider


  • @Documented
    @Target(TYPE)
    @Retention(SOURCE)
    @Repeatable(List.class)
    public @interface ServiceProvider
    Declarative registration of a service provider.

    Current features:

    • generates classpath files in META-INF/services folder
    • supports multiple registration of one class
    • can infer the service if the provider implements/extends exactly one interface/class
    • checks coherence between classpath and modulepath if module-info.java is available

    Current limitations:

    • detects modulepath public static provider() method but doesn't generate a workaround for classpath
    Author:
    Philippe Charles
    • Optional Element Summary

      Optional Elements 
      Modifier and Type Optional Element Description
      Class<?> value
      The interface (or class) to register this implementation under.
      This value is optional if the provider implements/extends exactly one interface/class.
    • Element Detail

      • value

        Class<?> value
        The interface (or class) to register this implementation under.
        This value is optional if the provider implements/extends exactly one interface/class.
        Returns:
        a non-null type
        Default:
        java.lang.Void.class