Package sting

Annotation Interface Fragment


Identify an interface that can contribute to a component graph. This annotation is a top-level Sting processor entrypoint.

The interface is expected to declare 1 or more default methods and/or include 1 or more types in the includes parameter. Sting actively processes Named, Typed, and Eager on provider methods declared by the fragment, and Named on provider method parameters. When Typed is present on a provider method, it defines the full set of service types published by that binding.

  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    Class<?>[]
    A list of types that can contribute to the component graph.
    boolean
    True if all explicitly included types must be declared in the same package as the fragment.
  • Element Details

    • includes

      @Nonnull Class<?>[] includes
      A list of types that can contribute to the component graph. The types can be Injectable-annotated classes or Fragment-annotated interfaces. The Fragment-annotated interfaces contributions are added recursively and contributions are de-duplicated before they are resolved.
      Returns:
      a list of types that contribute to the fragments component graph.
      Default:
      {}
    • localOnly

      boolean localOnly
      True if all explicitly included types must be declared in the same package as the fragment.
      Returns:
      true to reject cross-package includes, false to permit them.
      Default:
      true