javadependency-injectionguicejsr330

Is there a javax.inject.* equivalent to @Assisted


We're looking at using the JSR-330 javax.inject.* annotations instead of the com.google.inject.* equivalents. It looks like the JSR-330 standard does not include several features that I've come to love in Guice.

Specifically, I see no support for the @Assisted keyword. Also, what about @AssistedInject? Is @Inject able to be placed on multiple constructors?

I'm interested in being vendor neutral, but not at the cost of handy features. Any recommendations?


Solution

  • @Assisted is Guice-only. You can use it with JSR 330's @Inject. If you don't want the Guice dependency, do manual assisted injection by implementing the factory interface in code.