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
1002
votes
3 answers

How to reference a method in javadoc?

How can I use the @link tag to link to a method? I want to change: /** * Returns the Baz object owned by the Bar object owned by Foo owned by this. * A convenience method, equivalent to getFoo().getBar().getBaz() * @return baz */ public Baz…
Jason S
  • 184,598
  • 164
  • 608
  • 970
900
votes
4 answers

Linking to an external URL in Javadoc?

Something like: /** * See {@linktourl http://google.com} */
ripper234
  • 222,824
  • 274
  • 634
  • 905
606
votes
18 answers

Multiple line code example in Javadoc comment

I have a small code example I want to include in the Javadoc comment for a method. /** * -- ex: looping through List of Map objects -- * * for (int i = 0; i < list.size(); i++) { * Map map = (Map)list.get(i); * …
Mark
  • 16,772
  • 9
  • 42
  • 55
511
votes
11 answers

How to see JavaDoc in IntelliJ IDEA?

I just switched from Eclipse to IntelliJ. IntelliJ lacks one feature from Eclipse - when you put your mouse over a method, Eclipse shows javadoc info. I think the way to show it is to use a shortcut - command+J, but when I click it, I get…
Eugene
  • 59,186
  • 91
  • 226
  • 333
386
votes
5 answers

How to add reference to a method parameter in javadoc?

Is there a way to add references to one or more of a method's parameters from the method documentation body? Something like: /** * When {@paramref a} is null, we rely on b for the discombobulation. * * @param a this is one of the parameters *…
ripper234
  • 222,824
  • 274
  • 634
  • 905
345
votes
19 answers

Maven is not working in Java 8 when Javadoc tags are incomplete

Since I use Maven I have been able to build and install in my local repository projects that have incomplete Javadoc tags (for example, a missing parameter). However, since I migrated to Java 8 (1.8.0-ea-b90) Maven is absolutely strict about…
Sergio
  • 8,532
  • 11
  • 52
  • 94
321
votes
3 answers

Javadoc link to method in other class

Currently I'm referencing methods in other classes with this Javadoc syntax: @see {@link com.my.package.Class#method()} And in what I understand from the documentation this is the correct way to do this. But now to the funny part, or frustrating.…
Robert
  • 4,602
  • 4
  • 22
  • 33
257
votes
12 answers

How to attach javadoc or sources to jars in libs folder?

New version of ADT r17 plugin for Eclipse added feature to automatically setup JAR dependencies. Any .jar files in the /libs folder are added to the build configuration now. Unfortunately Android Dependencies classpath container is non…
Sergii Pechenizkyi
  • 22,227
  • 7
  • 60
  • 71
248
votes
19 answers

How to generate javadoc comments in Android Studio

Can I use shortcut keys in Android studio to generate javadoc comments? If not, what is the easiest way to generate javadoc comments?
qinxianyuzou
  • 2,514
  • 2
  • 13
  • 8
235
votes
1 answer

Javadoc: package.html or package-info.java

When trying to create package level Javadoc comments, whats the preferred method? What do you do? package-info.java Pros Newer Cons Abuse of a class - Classes are for code, not for only comments package.html Pros HTML extension means its…
TheLQ
  • 14,830
  • 14
  • 69
  • 107
217
votes
9 answers

/** and /* in Java Comments

What's the difference between /** * comment * * */ and /* * * comment * */ in Java? When should I use them?
Dev
  • 13,492
  • 19
  • 81
  • 174
214
votes
5 answers

codestyle; put javadoc before or after annotation?

I know that it isn't the most vital of issues, but I just realised that I can put the javadoc comment block before or after the annotation. What would we want to adopt as a coding standard? /** * This is a javadoc comment before the annotation …
Paul McKenzie
  • 19,646
  • 25
  • 76
  • 120
213
votes
5 answers

How can I generate Javadoc comments in Eclipse?

Is there a way to generate Javadoc comments in Eclipse? If so, what is it?
antony.trupe
  • 10,640
  • 10
  • 57
  • 84
212
votes
5 answers

How can you escape the @ character in javadoc?

How can I escape the @ symbol in javadoc? I am trying to use it inside a {@code} tag, which is inside
 tags.
I already tried the html escape @ sequence, but that didn't work.
JayL
  • 2,819
  • 4
  • 22
  • 15
211
votes
4 answers

Javadoc @see or {@link}?

Could someone tell me the difference between javadoc @see and {@link}? Or rather, when to use which of them?
membersound
  • 81,582
  • 193
  • 585
  • 1,120
1
2 3
99 100