2 Replies Latest reply on May 12, 2012 12:22 PM by Ales Justin

    Injection without @Inject annotation

    John Doe Newbie

      I wonder why @Inject annotation is needed in case when a field is also annotated with some qualifiers? What is the purpose of writing:

      @Inject @MyQualifier private Object field;

      instead of

      @MyQualifier private Object field;


      Is there any way to inject the field by only qualifier annotation with Weld? I tried and create an extension that observes ProcessInjectionTarget event and returned a completely new InjecionTarget with created InjectionPoint. But the code is realy huge and hacky because it seems there is no simple way to create a custom FieldInjectionPoint at runtime.