6

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.

Community
  • 1
  • 1
MichaBa
  • 465
  • 4
  • 8
  • Here is another one: http://stackoverflow.com/questions/1120455/how-do-i-exclude-a-specific-method-constructor-from-the-results-of-the-javadoc-a?lq=1 No great answers there, either. Someone mentions a doclet to exclude things. – Thilo Jan 22 '15 at 07:22

2 Answers2

5

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

/**
 * @hidden
 */
@Override
public void run() {
   ...
}
Asa
  • 161
  • 1
  • 4
4

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.

Ankur Singhal
  • 26,012
  • 16
  • 82
  • 116