Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does the javadoc tool recognize comments inside methods?

Tags:

java

javadoc

I have written a lot of comments inside my business logic like that:

/**
 * Do some important stuff.
 * @param pDog
 * @param pAllDogTraining
 * @return
 */
@Overwrite
public Map<DogId, Dog> doEvaluateAllDog(final Dog pDog, final Collection<DogTraining> pAllDogTraining) {
final Map<DogId, Dog> lAllDogBad = new HashMap<DogId, Dog>();
final List<DogTraining> lAllDogTraining = new ArrayList<DogTraining>(pAllDogTraining);

/**
 * Remove deleted entries.
 * Detailed description
 */
removeDeletetTrainings(lAllDogTraining);

/**
 * Set the priority for each training
 *  - bad dogs
 *  - nice dogs
 *  - unknown dogs
 * Detailed description
 */
Collections.sort(lAllDogTraining, new DogTrainingComparator());

// Iterate over training elements and set the conflict state
for(.....

My question is, does the javadoc tool recognize the doc comments inside my method blocks too? In the near future we will offer a technical documentation and the JavaDoc of our project will be part of it.

like image 756
s_bei Avatar asked Mar 19 '13 10:03

s_bei


People also ask

How do you write a javadoc comment for a method?

Writing Javadoc Comments In general, Javadoc comments are any multi-line comments (" /** ... */ ") that are placed before class, field, or method declarations. They must begin with a slash and two stars, and they can include special tags to describe characteristics like method parameters or return values.

What is the purpose of the javadoc tool?

Javadoc is a tool for generating API documentation in HTML format from doc comments in source code. It can be downloaded only as part of the Java 2 SDK. To see documentation generated by the Javadoc tool, go to J2SE 1.5. 0 API Documentation.

What is javadoc explain the comments for classes methods fields and link?

What is Javadoc? Javadoc is a tool which comes with JDK and it is used for generating Java code documentation in HTML format from Java source code, which requires documentation in a predefined format. Following is a simple example where the lines inside /*…. */ are Java multi-line comments.

Do you need javadoc comments for private methods?

Nope, you shouldn't write javadoc for private methods. End users don't have access to private fields or methods so there really isn't a point in providing javadoc for them. Private fields and methods are only meant for the developer. If you really need to though, feel free to write comments for non-obvious logic.


1 Answers

does the javadoc tool recognize the doc comments inside my method blocks too?

No.

A JavaDoc comment is a multi-line comment starting with /** that immediately precedes a class declaration or a method or attribute of the class.

like image 197
Andrew Thompson Avatar answered Sep 18 '22 20:09

Andrew Thompson