001package io.avaje.inject.spi;
002
003import java.lang.annotation.ElementType;
004import java.lang.annotation.Retention;
005import java.lang.annotation.RetentionPolicy;
006import java.lang.annotation.Target;
007
008/**
009 * Registers {@link InjectPlugin} classes for auto-detection with JPMS.
010 *
011 * <p>Plugins can be registered with the ServiceLoader manually, but manually registered plugins may cause dependency missing
012 * errors to consumers using JPMS. (This can be fixed if the consumer uses the inject maven/gradle plugin)
013 *
014 * <p>If we use this {@code @PluginProvides} annotation, then avaje inject can auto-detect the
015 * plugin and the types that it provides when a consumer uses JPMS. This eliminates the need for a plugin consumer to take action.
016 */
017@Target(ElementType.TYPE)
018@Retention(RetentionPolicy.CLASS)
019public @interface PluginProvides {
020
021  /**
022   * The types this plugin provides.
023   */
024  Class<?>[] value() default {};
025
026  /**
027   * Fully Qualified Strings of the classes provided. Use when providing generic types
028   */
029  String[] providesStrings() default {};
030
031  /**
032   * The aspects this component provides.
033   */
034  Class<?>[] providesAspects() default {};
035}