I am having a problem with generating Javadoc for Lombok getters and setters. I have tried both suggestions here. An example field and its text are as follows:
/** * Identifier of the client * * @param clientID changes the id of the client * @return id of the client */ @Getter @Setter private Integer clientID;
However, I see neither the getter nor the setter in the generated Javadoc. I am using 'protected' visibility on Eclipse (Project -> Generate Javadoc...). My Lombok version is 1.12.4. Any suggestions?
The @Getter annotation is used to generate the default getter implementation for fields that are annotated with the annotation. This annotation can also be used at the class level in which Lombok will generate the getter methods for all fields.
From Lombok documentation: You can always manually disable getter/setter generation for any field by using the special AccessLevel. NONE access level. This lets you override the behaviour of a @Getter, @Setter or @Data annotation on a class.
Getters and Setters play an important role in retrieving and updating the value of a variable outside the encapsulating class. A setter updates the value of a variable, while a getter reads the value of a variable.
The javadoc feature does not work in the eclipse javadoc view or hovers. You can generate the javadoc by running delombok on the code first and then run the javadoc compiler, as is hinted on the feature page near the bottom.
Disclosure: I am a Lombok developer.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With