1

How do I exclude a protected method from javadoc?

I need to document some but not all protected methods.

Thanks

user2381422
  • 5,645
  • 14
  • 42
  • 56

3 Answers3

0

You can exclude all protected methods with the command line option "-protected", but I just re-read your question more closely and realize this is probably not what you are looking for.

Kevin Welker
  • 7,719
  • 1
  • 40
  • 56
0

You can't do this with straight Javadoc but, depending on what other javadoc facilities you need, and how it is you are generating your javadoc, you could consider switching to Doclava. Doclava is a doclet (think: plug-in) for javadoc and it does recognise the @hide tag.

The HTML output is much prettier too.

Unfortunately it doesn't recognise large swathes of javadoc command line options, so it may not be suitable.

https://code.google.com/p/doclava/

Cheeseminer
  • 2,948
  • 1
  • 20
  • 36
0

If you are using the maven plugin, you can use the show tag into the configuration tag with value public as shown below. In that case, only public members of classes will be displayed into javadoc.

        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-javadoc-plugin</artifactId>
            <version>2.10.1</version>
            <configuration>
                <show>public</show>
                <doctitle>My company API</doctitle>
                <subpackages>my.company.package.api</subpackages>
            </configuration>
        </plugin>