Questions tagged [javadoc]

Javadoc is an extensible documentation generation system which reads specially formatted comments in Java source code and generates compiled documentation. It is typically used to produce API documentation in the form of HTML web pages.

Javadoc is an extensible documentation generation system which reads specially formatted comments in Java source code and generates compiled documentation. It is typically used to produce API documentation in the form of HTML web pages.

A Javadoc comment starts with /** (an extra star to the normal multi-line comment) and ends with */. It also makes use of tags (starting with @).

Resources

2947 questions
127
votes
1 answer

How can I reference the value of a final static field in the class?

Using JavaDoc, how can I reference the value of a final static field in the class? I want the ??? in this example replaced by the value of the field STATIC_FIELD. /** * This is a simple class with only one static field with the value ???. …
Simon
  • 4,103
  • 7
  • 28
  • 53
127
votes
5 answers

How do I change the Javadocs template generated in Eclipse?

I dislike the default Javadocs generated for me when I create a Class or methods, especially the @author variable, which is the current system username on my windows box. I would like to change it. Is this possible?
Olaseni
  • 7,698
  • 16
  • 44
  • 68
125
votes
6 answers

Autocompletion of @author in Intellij

I'm migrating from Eclipse to Intellij Idea. One thing I couldn't figure out yet is autocompletion of the @author JavaDoc tag. When typing @a in Eclipse, there are two proposals: @author - author name @author How do I achieve the first proposal in…
Sandra
  • 3,560
  • 5
  • 24
  • 31
124
votes
4 answers

Netbeans: how to change @author

When creating a new class or interface in Netbeans IDE, an "@author ...." tag appears. How to change its value? If possible, I would like to change it by using Netbeans menu and not by editing some config files :) I'm using Netbeans 7.2
Lukasz Czerwinski
  • 13,499
  • 10
  • 55
  • 65
121
votes
7 answers

Should Javadoc comments be added to the implementation?

Is it correct practice to add Javadoc comments in the interface and add non-Javadoc comments in the implementation? Most IDEs generate non-JavaDoc comments for implementations when you auto generate comments. Shouldn't the concrete method have the…
Vaishak Suresh
  • 5,735
  • 10
  • 41
  • 66
120
votes
2 answers

How to link javadoc to private field?

how can I make a javadoc link to a private field? class Foo { private String bar; public String getBar() { return bar; } } {@link Foo#getBar()} works. {@link Foo#bar} doesn't.
membersound
  • 81,582
  • 193
  • 585
  • 1,120
112
votes
1 answer

Details of difference between @see and @inheritDoc

I have looked over JavaDoc reference, and while I understand basic difference between @see (various links) and {@inheritDoc} (export of superclass JavaDoc comment), I need clarification on how things actually implemented. In Eclipse IDE when I…
theUg
  • 1,284
  • 2
  • 9
  • 14
104
votes
13 answers

Android Studio quick documentation always "fetching documentation"

I just moved to Android Studio from Eclipse, and I found that it always shows "fetching documentation" when I use quick documentation (Ctrl+Q). How can I solve this problem? I downloaded the documentation for API 19, and the problem persists.
Bruce
  • 1,645
  • 3
  • 15
  • 14
102
votes
4 answers

How to write Javadoc of properties?

I often find myself with a dilemma when writing javadoc for properties/members of a "simple" POJO class holding only properties and getters and setters (DTO-style).... 1) Write javadoc for the property or... 2) Write javadoc for the getter If I…
user274360
100
votes
7 answers

Javadoc: line breaks without HTML-tags?

Sorry for a probable FAQ kind of question, but I just can't find the answer. As far as I remember Eclipse, a blank line in a Javadoc comment is displayed (in in-source Javadoc popups) as a line break (with extra vertical spacing). In Netbeans,…
java.is.for.desktop
  • 10,748
  • 12
  • 69
  • 103
97
votes
4 answers

Javadoc reuse for overloaded methods

I'm developing an API with many identically named methods that just differ by signature, which I guess is fairly common. They all do the same thing, except that they initialize various values by defaults if the user does not want to specify. As a…
skrebbel
  • 9,841
  • 6
  • 35
  • 34
96
votes
3 answers

How to Javadoc a Class's Individual Enums

I am writing the Javadoc for a class that contains its own enums. Is there a way to generate Javadoc for the individual enums? For example, right now I have something like this: /** * This documents "HairColor" */ private static enum HairColor {…
Snowy Coder Girl
  • 5,408
  • 10
  • 41
  • 72
85
votes
5 answers

Should I use JavaDoc deprecation or the annotation in Java?

There are at the moment, two ways to mark code as depreacted in java. Via JavaDoc /** * @deprecated */ Or as an annotation: @Deprecated This is my problem - I find it a bit too much to declare both, when marking a method as deprecated when using…
corgrath
  • 11,673
  • 15
  • 68
  • 99
84
votes
12 answers

Are there some good and modern alternatives to Javadoc?

Let's face it: You don't need to be a designer to see that default Javadoc looks ugly. There are some resources on the web which offer re-styled Javadoc. But the default behaviour represents the product and should be as reasonably…
ivan_ivanovich_ivanoff
  • 19,113
  • 27
  • 81
  • 100
83
votes
13 answers

How to attach source or JavaDoc in eclipse for any jar file e.g. JavaFX?

Presently I'm working with JavaFX. Whenever I hover over a method of JavaFX its gives me the following error: 'Note: This element neither has attached source nor attached Javadoc and hence no Javadoc could be found' How should I resolve this? How…
Dhruv
  • 10,291
  • 18
  • 77
  • 126