Annotation Type ProvidesIntoMap

  • @Documented
    public @interface ProvidesIntoMap
    Annotates methods of a Module to add items to a MapBinder. The method's return type, binding annotation and additional key annotation determines what Map this will contribute to. For example,
     Plugin provideFooUrl(FooManager fm) { return fm.getPlugin(); }
     Plugin provideBarUrl(BarManager bm) { return bm.getPlugin(); }
    will add two items to the @Named("plugins") Map<String, Plugin> map. The key 'Foo' will map to the provideFooUrl method, and the key 'Bar' will map to the provideBarUrl method. The values are bound as providers and will be evaluated at injection time.

    Because the key is specified as an annotation, only Strings, Classes, enums, primitive types and annotation instances are supported as keys.