Annotation Interface Service.Inject

Enclosing class:
Service

@Retention(CLASS) @Target({METHOD,CONSTRUCTOR,FIELD}) @Documented public static @interface Service.Inject
Method, constructor, or field marked with this annotation is considered as injectable, and its injection points will be satisfied with services from the service registry. An injection point is a field, or a single parameter.

An injection point may expect instance of a service, or a Supplier of the same.

Annotating an inaccessible component will always be marked as an error at compilation time (private fields, methods, constructors).

Annotating a final field will always be marked as an error at compilation time.

We recommend to use constructor injection, as field injection makes testing harder.