It means that the generated constructor (not controller) will also have the @Autowired
annotation added to it so that spring can do its magic. With lombok you can write your code like
@RequiredArgsConstructor(onConstructor=@__(@Autowired(required=true)))
public class FooController {
private final FooService service;
interface FooService {}
}
and lombok will convert it during compilation to
public class FooController {
private final FooService service;
@Autowired(required=true)
public FooController(FooService service) {
this.service = service;
}
}
@__
is used to overcome the type limitations of annotations because
@interface MultipleAnnotations {
Annotation[] value();
}
does not work because the supertype of all annotations is itself not an annotation and
@interface MultipleAnnotations {
Class<? extends Annotation>[] value();
}
does not allow parameters in annotations: @MultipleAnnotations(SomeAnnotation.class)