Injection point metadata

There is lots of useful metadata information that is present on an injection point, which is represented in the javax.enterprise.inject.spi.InjectionPoint interface. Weld provides an implementation of InjectionPoint with @Dependent scope and @Default qualifier for us to retrieve the metadata.

The injection point provides the following functions:

  • getBean(): This returns the Bean object of the bean defined on the injection point
  • getType(): This returns the bean type of the injection point
  • getQualifiers(): This returns all the qualifiers of the injection point
  • getMember(): This returns a different instance depending on whether the injection point utilizes field injection (Field), method parameter injection (Method), or constructor ...

Get JBoss Weld CDI for Java Platform now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.