Hello,

On Tue, Jul 2, 2013 at 1:03 PM, Stuart McCulloch <[email protected]> wrote:
> Adding @Inherited would have no effect because @Provides is used to annotate 
> methods and @Inherited only affects annotations on classes:
>
>         "Note that this meta-annotation type has no effect if the annotated 
> type is used to annotate anything other than a class"
>
>         from 
> http://docs.oracle.com/javase/6/docs/api/java/lang/annotation/Inherited.html
>
> Have you tried using something like:
>
>         @Provides public final Something providesSomething() {return 
> getSomething();}
>
>         public abstract Something getSomething();
>
> Although IMHO it is better to have @Provides closer to the implementation 
> rather than squirrelled away somewhere in the class hierarchy
>

Uhm, I should read the documentation better... And I never imagined
this obvious workaround.

Thanks! I'll try and do something more sane in the future... Still a
beginner with DI...

--
Francis Galiegue, [email protected]
JSON Schema in Java: http://json-schema-validator.herokuapp.com

-- 
You received this message because you are subscribed to the Google Groups 
"google-guice" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-guice.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to