Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

I use Lombok project but getter's and setter's don't have JavaDoc

Tags:

javadoc

lombok

I use Lombok project but getter's and setter's don't have JavaDoc.

How can i activate this option?

like image 875
user2232857 Avatar asked Apr 01 '13 16:04

user2232857


People also ask

How do you get getter and setter in Lombok?

You can annotate any field with @Getter and/or @Setter , to let lombok generate the default getter/setter automatically. A default getter simply returns the field, and is named getFoo if the field is called foo (or isFoo if the field's type is boolean ).

How do I add getters and setters in spring boot?

After you have created the variables in the class, right click, select Source, select Generate Getters and Setters.

What can I use instead of getters and setters?

You may use lombok - to manually avoid getter and setter method. But it create by itself. The using of lombok significantly reduces a lot number of code.

How do you override a Lombok getter?

This access level lets us override the behavior of a @Getter, @Setter, or @Data annotation on a class. To override the access level, annotate the field or class with an explicit @Setter or @Getter annotation.


1 Answers

There is an inititial implementation in the 0.12.0 release. By default the whole content form the javadoc on the field will be copied to both the getter and the setter. Getters will get the return bit; setters the param bit. Those will be removed from the javadoc on the field. Using sections you can even specify different getter/setter javadoc.

This only works when you delombok the code before generating javadoc, and will probably never work in eclipse.

For the current syntax, please check the feature requests documentation.

Full Disclosure: I am one of the Project Lombok developers.

like image 139
Roel Spilker Avatar answered Nov 17 '22 02:11

Roel Spilker