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.
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.
Yes. If you don't have javadoc comments on a subclass, javadocs will be be generated based on the superclasses javadoc.
Javadoc provides the @link inline tag for referencing the members in the Java classes. We can think of the @link tag as similar to the anchor tag in HTML, which is used to link one page to another via hyperlinks. Similar to the anchor tag, the path_to_member is the destination, and the label is the display text.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With