001package sting;
002
003import java.lang.annotation.Documented;
004import java.lang.annotation.ElementType;
005import java.lang.annotation.Retention;
006import java.lang.annotation.RetentionPolicy;
007import java.lang.annotation.Target;
008import javax.annotation.Nonnull;
009
010/**
011 * Identify an interface that can contribute to a component graph.
012 * The interface is expected to declare 1 or more default methods and/or
013 * include 1 or more types in the {@link #includes() includes} parameter.
014 */
015@Documented
016@Retention( RetentionPolicy.RUNTIME )
017@Target( ElementType.TYPE )
018public @interface Fragment
019{
020  /**
021   * A list of types that can contribute to the component graph.
022   * The types can be {@link Injectable}-annotated classes or {@link Fragment}-annotated interfaces.
023   * The {@link Fragment}-annotated interfaces contributions are added recursively and contributions are
024   * de-duplicated before they are resolved.
025   *
026   * @return a list of types that contribute to the fragments component graph.
027   */
028  @Nonnull
029  Class<?>[] includes() default {};
030}