2 Replies Latest reply on Jul 24, 2015 4:11 AM by chrisjr

    Easier access to InjectionPoint qualifiers?

    chrisjr

      Hi,

       

      It appears that the only reliable way of analysing all of the qualifiers on a given injection point is via the javax.enterprise.inject.spi.InjectionPoint.getQualifiers() method, because annotation literals passed to Instance.select() are not associated with the result of InjectionPoint.getAnnotated(). (Logically enough, I suppose). However, InjectionPoint.getQualifiers() returns a rather unhelpful Set<Annotation> which I almost always have to convert into a Map<Class<? extends Annotation>, Annotation> structure before I can analyse in any meaningful way. It would be so much easier if InjectionPoint also exported APIs like:


      boolean isQualifierPresent(Class<? extends Annotation> annotationType);
      
      <T extends Annotation> T getQualifier(Class<T> annotationType);
      
      

       

      c.f. javax.enterprise.inject.spi.Annotated.

       

      Does anyone have any thoughts about this, please? Or does something like this already exist?

       

      Cheers,

      Chris