|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT | |||||||||
@Retention(value=RUNTIME)
@Target(value={METHOD,FIELD,PARAMETER})
public @interface Optional
Marker annotation indicating that an instance variable or method marked with Inject
is not required to be present at run-time. If the service is not present, there will be no error and
injection will not be performed.
Example:
@Inject
@Optional
MyContract myOptionalService;
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT | |||||||||