Hope to see Method-Doc with Lombok.

38 views
Skip to first unread message

Jang Ho Hwang

unread,
Oct 5, 2009, 5:53:36 AM10/5/09
to Project Lombok
Hi guys,

I have a plan to migrate my project with Lombok because my POJOs don't
have any special logics in there and want to attach @ToString and
@EqualsAndHashCode. Of course, this is not good practice i think. I
just want to reduce trivial code blocks from my project.

However, I really want to insert method-doc in my POJO classes.
Because some attributes of my class have to represent that what this
attribute means. But I couldn't find any solutions with lombok so far.

An approach to solve this issue what I made is to change modifiers of
fields from private to protected and wrote field-doc like below..

/**
* URL of user's profile picture. It can be 'http://foo/bar/
default.png' if the user doesn't set their picture.
*/
@Getter protected java.net.URL profilePicture;

and ran javadoc and got a document.

But it is not beauty I think. And I don't want to insert '-private'
option to run with javadoc.

Any ideas or advices?

Reinier Zwitserloot

unread,
Oct 5, 2009, 6:08:29 AM10/5/09
to Project Lombok
I don't really have a better idea than what you're doing, I'm afraid.
Possibly we can put in some logic to copy javadocs from private
members to both setter and getter. Is that a good idea?

Jang Ho Hwang

unread,
Oct 5, 2009, 6:46:39 AM10/5/09
to Project Lombok
If lombok will supports that copying javadocs from private members, it
would be better I think.

A concern I had was the possibility whether copying javadocs to setter
and getter is possible or not.
The reason that I thought was that generated javadoc didn't have any
method-docs.

Thanks.

Reinier Zwitserloot

unread,
Oct 5, 2009, 11:55:42 AM10/5/09
to Project Lombok
Currently generated methods don't have javadoc. Generated methods
don't even show up when you run javadoc on your code.

Please make an issue in the issuetracker at http://code.google.com/projectlombok/issues
to copy any javadoc on a (package) private field to the generated
getter and setter. We'll get around to it someday.
Reply all
Reply to author
Forward
0 new messages