Can @Inject be made option in JSR 330 (like @Autowire(required=false)?

Posted by Eric B. on Stack Overflow See other posts from Stack Overflow or by Eric B.
Published on 2013-10-21T03:35:15Z Indexed on 2013/10/21 3:53 UTC
Read the original article Hit count: 144

Filed under:
|
|
|

Spring's @Autowire can be configured such that Spring will throw an error if no matching autowire candidates are found: @Autowire(required=false)

Is there an equivalent JSR-330 annotation? @Inject always fails if there is no matching candidate. Is there any way I can use @Inject but not have the framework fail if no matching types are found? I haven't been able to find any documentation to that extent.

© Stack Overflow or respective owner

Related posts about java

Related posts about spring