Java Reference
In-Depth Information
from source code specified in your project settings. If no JavaDoc is found in the
source (or you don't have the source), then only the method's signature informa-
tion is displayed.
The Quick JavaDoc window is fully navigable. In our example, you can click
the link to the
java.lang.Number
class to view its JavaDoc. Once you navigate to
another element, a small toolbar appears in the Quick JavaDoc window, allowing
you to navigate back and forth and to view the JavaDoc in a browser window.
Viewing the full JavaDoc in an external browser
For a little more information, you can use the
View | External JavaDoc
(
Shift+F1
) feature to view the JavaDoc of any symbol with your browser in its
native
HTML
format. The editor locates the JavaDoc by searching your JavaDoc
entries for the symbol's containing class. Of course, this only works if you have
added and made
IDEA
aware of the appropriate
API
documentation. This com-
mand handles local JavaDoc files as well as those hosted on a web site, provided
you have set up your
JDK
with a reference to the JavaDoc files as described in
chapter 1.
3.5.3
Creating JavaDoc comments
IDEA
provides a number of features to help you generate and maintain your Java-
Doc.
IDEA
will get you started by stubbing out the JavaDoc of any method for you.
Simply type the opening block comment brace
/**
, and press Return.
IDEA
will
add the applicable parameter attributes and the
throws
clauses where necessary,
and will close the comment automatically. You can disable this behavior in the
Editor
settings by disabling the
JavaDoc stubs
option under the
Smart Keys
group. Here's what
IDEA
generated for the
requestCurrentRate
method:
/**
*
* @param fromCurrency
* @param toCurrency
* @return
*/
public double requestCurrentRate(String fromCurrency,
String toCurrency) { ... }
Now all you have to do is add any explanatory text and descriptions of the
parameters and return type.
IDEA
will alert you to any errors in syntax or usage
for your JavaDoc.
You can customize
IDEA
's handling of JavaDoc syntax-checking in the
Errors
section of your
IDE
Settings
. Here you can specify whether problems