onMethod=,onParam=,onConstructor=

Overview

Lombok lets you add your favorite annotation to methods generated by @Getter and @Setter by using the attribute onMethod on the lombok annotation. You can specify annotations to the parameters of the method on @Setter with the attribute onParameter. You can add annotation to constructors generated by @NoArgsConstructor, @RequiredArgsConstructor and @AllArgsConstructor by using the attribute onConstructor

With Lombok

@HTML_PRE@

Vanilla Java

@HTML_POST@

Small print

When the @Getter or @Setter annotation is placed on the type in stead of a field, using the attribute is not supported and it will result in a warning.