MichaBa
MichaBa

Reputation: 485

Exclude methods from the javadoc

we use the javadoc to generate a test documentation report of our JUnit tests. that works so far. But we want to exclude the methods like @BeforeClass @AfterClass @Before @After , but they have to be public.

I've found a similar question in stackoverflow. I don't want to mark methods as deprecated.

Upvotes: 8

Views: 7549

Answers (2)

Asa
Asa

Reputation: 181

Actually it appears that this functionality has finally been implemented and the solution is illustrated below by example:

/**
 * @hidden
 */
@Override
public void run() {
   ...
}

Upvotes: 7

Ankur Singhal
Ankur Singhal

Reputation: 26077

We cannot do this for public methods.

Also, a tag might be added, @exclude tag

From Docs.

@exclude

For API to be excluded from generation by Javadoc. Programmer would mark a class, interface, constructor, method or field with @exclude. Presence of tag would cause API to be excluded from the generated documentation. Text following tag could explain reason for exclusion, but would be ignored by Javadoc. (Formerly proposed as @hide, but the term "hide" is more appropriate for run-time dynamic show/hide capability.) For more discussion, see: Feature Request #4058216 in Developer Connection.

you might get some alternative here.

Upvotes: 4

Related Questions