Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

String content in javadoc

I was wondering, is it possible to generate javadoc for public String constants to generate javadoc which contains its content? E.g. For field:

public static final String MENU = "menu_2";

it would generate javadoc like this:

 /**
  * value: menu_2
  */
like image 871
Kamil Kalinowski Avatar asked Jan 15 '23 00:01

Kamil Kalinowski


2 Answers

You can reference it directly in the comment:

/**
 * MENU static field whose value is: {@value #MENU}
 */
public static final String MENU = "menu_2";
like image 200
Alex Avatar answered Jan 22 '23 09:01

Alex


Use value tag /**value: {@value}*/. See this link for javadoc tags: http://docs.oracle.com/javase/6/docs/technotes/tools/windows/javadoc.html#javadoctags.

like image 29
Aleksandr M Avatar answered Jan 22 '23 08:01

Aleksandr M