[英]How to exclude certain class/packages/public members from javadoc
I have created java api -ported from C# to be more specific- which aside from public interface, contains a lot of internal stuff that I don't want a user to know about. 我创建了java api-从C#移植到更具体-在公共接口之外,它包含许多我不希望用户知道的内部内容。 In C#, I have used doxygen to generate documentation. 在C#中,我使用了doxygen来生成文档。 I presume javadoc has similar features to exclude certain public members, classes, even packages. 我认为javadoc具有类似的功能,可以排除某些公共成员,类甚至程序包。
Would someone suggest how do that, perhaps via eclipse? 有人会建议如何做,也许通过日食吗?
Thanks 谢谢
I believe that in Eclipse, the only kind of exclusions you can specify are things like "exclude all protected members" and package-based exclusions (not class-based exclusions.) 我相信,在Eclipse中,您可以指定的唯一排除类型是诸如“排除所有受保护成员”和基于包的排除(不是基于类的排除)。
If you're using Ant to generate them, you can use the nested "package" element, and you can use a fileset nested element and add exclusions to that fileset. 如果要使用Ant生成它们,则可以使用嵌套的“ package”元素,也可以使用文件集nested元素,并将排除项添加到该文件集。
For example: 例如:
<javadoc >
<sourcefiles>
<fileset dir="${src}">
<include name="**/*.java"/>
<exclude name="**/ClassToExclude.java"/>
</fileset>
</sourcefiles>
<packageset>
<dirset dir="${src}">
<include name="com.mydomain.*"/>
<exclude name="com.mydomain.excludePackage"/>
</dirset>
</packageset>
</javadoc>
PS - I've used the <sourcefiles>
element alot, but never the <packageset>
element. PS-我已经大量使用了<sourcefiles>
元素,但从未使用过<packageset>
元素。 The latter might not be spot-on syntactically. 后者可能不会在语法上出现。
Sure, when you "Generate Javadoc", you can select the package concerned by this process and exclude the others 当然,当您“ Generate Javadoc”时,您可以选择此过程涉及的软件包,并排除其他软件包
alt text http://www.filigris.com/products/docflex_javadoc/images/eclipse_javadoc_1.png 替代文字http://www.filigris.com/products/docflex_javadoc/images/eclipse_javadoc_1.png
(here the picture shows the javadoc generated with another tool, but that does not change the general idea) (这里的图片显示了使用其他工具生成的javadoc,但这并没有改变总体思路)
You can use doxygen with Java. 您可以在Java中使用doxygen。 I am not aware of any tools that do what you want with Javadoc. 我不知道有什么工具可以用Javadoc来完成您想做的事情。
Superpackages should be coming in JDK 7 which I beleive could address this: http://blogs.oracle.com/andreas/entry/superpackages_in_jsr_294 超级软件包应该出现在JDK 7中,我相信可以解决这个问题: http : //blogs.oracle.com/andreas/entry/superpackages_in_jsr_294
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.