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
52
votes
4 answers

/* (non-javadoc) meaning

Possible Duplicate: Does “/* (non-javadoc)” have a well-understood meaning? What does the following statements mean? /* (non-Javadoc) * * Standard class loader method to load a class and resolve it. * * @see…
Dr. Mian
  • 3,334
  • 10
  • 45
  • 69
52
votes
5 answers

File.mkdir or mkdirs return false - Reason?

Why file.mkdir is returning false? Google indicates that there could be several reasons (e.g. security, permissions, pathname, etc). My questions: How to find the exact reason of returning false? If security/permissions is a reason, then why is…
Sandeep Jindal
  • 14,510
  • 18
  • 83
  • 121
51
votes
9 answers

Generate JavaDocs with Android Gradle plugin

How can I generate JavaDocs for an Android project using the new Gradle build system? Here is what I have come up with but it doesn't work. task generateJavadoc(type: Javadoc) { source = android.sourceSets.main.java.srcDirs ext.cp =…
Matt Accola
  • 4,090
  • 4
  • 28
  • 37
51
votes
1 answer

How to reference another method of the same class in Javadoc?

Suppose your class has 2 methods: contains() and containsSame() The distinction between them is subtle and you'd like to mention it as part of Javadoc In Javadoc, how can you reference a method in the same class, by name?
James Raitsev
  • 92,517
  • 154
  • 335
  • 470
50
votes
3 answers

What is the best way to use JavaDoc to document a Java enum?

I've just started using Java's enums in my own projects (I have to use JDK 1.4 at work) and I am confused as to the best practice of using JavaDoc for an enum. I have found that this method works, but the resultant code is a little unrefined: /** *…
MetroidFan2002
  • 29,217
  • 16
  • 62
  • 80
50
votes
3 answers

Javadoc @see object method

I would like to link a method of another object using @see from a comment block @see is only giving me the option to link classes, not methods. What is the hack? public class A { B bee; /** * Just invoking methodB on bee. * @see…
MonoThreaded
  • 11,429
  • 12
  • 71
  • 102
48
votes
7 answers

How do you escape curly braces in javadoc inline tags, such as the {@code} tag

/** * Gets the meatball icon for a nincompoop. * *

* Example: {@code } * * @author King Cong * */ The "${person}" part breaks the doc comment because it uses curly…

user76292
48
votes
7 answers

How to add package level comments in Javadoc?

I am using CheckStyle, FindBugs, and PMD to validate my Java code. I have fixed almost all the bugs caught by these tools. I am not able to understand how to write "package comment" which is a bug caught by checkstyle. I have gone through the…
Anil Kumar.C
  • 481
  • 1
  • 4
  • 3
48
votes
4 answers

Display JavaDocs on GitHub

I'm looking for a way to convert the javadocs from my open source project (generated in Eclipse) to GitHub MarkDown, or come up with some other simple solution to display my documentation on GitHub (shy of simply adding a docs directory). Is there a…
Phil
  • 35,852
  • 23
  • 123
  • 164
48
votes
4 answers

Javadoc @return tag comment duplication necessary?

For functions that don't change the state of an instance, the javadoc comment for the method is often the same or very similar as the one for the @return-tag in the Java-API. boolean Collection.isEmpty() Returns true if this collection contains no…
Konrad Höffner
  • 11,100
  • 16
  • 60
  • 118
47
votes
4 answers

How do I add package level annotations or edit package-info.java?

I'm trying to add package level annotations but I don't have a clue on how to do it. Examples are appreciated.
link_boy
  • 1,025
  • 4
  • 12
  • 23
47
votes
4 answers

How to make generated classes contain Javadoc from XML Schema documentation

I'm currently working with an XML Schema that has / on most types and elements. When I generate Java Beans from this XML Schema, then the Javadoc of those Beans only contains some generic generated information…
Joachim Sauer
  • 302,674
  • 57
  • 556
  • 614
46
votes
6 answers

Is there a way to speed up Javadoc (takes 7 minutes)

I am building a Javadoc for a module with 2,509 classes. This currently takes 7 min or 6 files per second. I have tried mvn -T 1C install However javadoc only uses 1 CPU. Is there a way to use more and/or speed up? I am using Oracle JDK 8 update…
Peter Lawrey
  • 525,659
  • 79
  • 751
  • 1,130
46
votes
3 answers

Javadoc in JUnit test classes?

Is it a best practice to put Javadoc comments in JUnit test classes and methods? Or is the idea that they should be so easy to read and simple that it is unnecessary to provide a narrative of the test intent?
Dave
  • 21,524
  • 28
  • 141
  • 221
46
votes
2 answers

How can weakCompareAndSet fail spuriously if it is implemented exactly like compareAndSet?

(note that this question is not about CAS, it's about the "May fail spuriously" Javadoc). The only difference in the Javadoc between these two methods from the AtomicInteger class is that the weakCompareAndSet contains the comment: "May fail…
SyntaxT3rr0r
  • 27,745
  • 21
  • 87
  • 120