Annotation Interface Service


@Documented @Retention(RUNTIME) @Target(TYPE) @Analyze("org.tentackle.buildsupport.ServiceAnalyzeHandler") public @interface Service
Annotation to express that the annotated class is a service implementation.

Processed at build time by the ServiceAnalyzeHandler of the tentackle-maven-plugin's analyze goal, which appends the annotated class to META-INF/services/<serviced class>. The annotation can also be used as a meta-annotation, i.e., to annotate another annotation (see AnnotationProcessor for an example).

  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
    Gets the serviced class.
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    boolean
    Determines whether the servicing class is the annotated class or the value of the annotated annotation.
    Notice the difference between the serviced and servicing class!
    The name of the element that provides the value, if this annotation is used as a meta-annotation.
    If meta() is false, the element of the annotated annotation provides the serviced class (only if value() is not given explicitly).
  • Element Details

    • value

      Class<?> value
      Gets the serviced class.
      Returns:
      the serviced class
    • method

      String method
      The name of the element that provides the value, if this annotation is used as a meta-annotation.
      If meta() is false, the element of the annotated annotation provides the serviced class (only if value() is not given explicitly). If meta() is true, it provides the servicing class. The default is "value".
      Returns:
      the element name
      Default:
      "value"
    • meta

      boolean meta
      Determines whether the servicing class is the annotated class or the value of the annotated annotation.
      Notice the difference between the serviced and servicing class!

      Meta services go to META-INF/meta-services instead of META-INF/services because the provider usually resides in another module.

      Returns:
      true if this is a meta annotation and the servicing class is provided by the annotated annotation
      Default:
      false