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

    Injection without @Inject annotation

    potamus

      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.