java - javadoc @hide can't work -


according link, wrote following code:

/**  * @hide  * */ public void mymethod() {     // } 

when use command generate doc:

$ javadoc -locale en_us -encoding utf-8 -charset utf-8 -d doc xxx.java 

the doc still have mymethod item. how hide mymethod? did miss ?

you using doclava tag, generating api documentation using standard doclet.

building doclava

the doclava source comes bundled ant script build doclet. "jar" task build jar containing doclava , necessary dependencies.

using doclava javadoc

the command line arguments pass javadoc use doclava are: -doclet com.google.doclava.doclava -docletpath ${jar.file}

as per official javadoc faq, hiding public members not possible in direct way.

occasionally might need make class or method public can accessible other packages, not because want part of public api. having these methods appear in documentation merely confuses application developers.

there no javadoc option hide, exclude or suppress public members javadoc-generated documentation.

several options available:

  • excluding source files - can pass javadoc source filenames classes want document, , exclude want omit. notice has granularity of files, not classes. therefore, if exclude source file contains nested classes, excluded. (you can put list of classes in command line argument file rather directly on command line.) default javadoc offers no way omit classes when passing in package names on command line.
  • excluding individual classes - can use exclude doclet. has finer granularity (class rather source file) previous option, , more natural use because explicitly list in file files want exclude.
  • excluding classes, methods , fields - ydoc doclet has capability, mark items exclusion tag in source code. in addition, welcome extend exclude doclet above methods , fields -- we'd happy publish , add name credits.

we considering @exclude proposed tag excluding members.

also check out proposed javadoc tags page more info @exclude , @hide.


Comments