Package org.jvnet.hk2.annotations
Annotation Type Optional
-
@Documented @Retention(RUNTIME) @Target({METHOD,FIELD,PARAMETER}) public @interface OptionalMarker annotation indicating that an instance variable or method marked withInjectis 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;