简体   繁体   English

如何从Javadoc中排除某些类/程序包/公共成员

[英]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.

相关问题 抽象类中没有公共成员 - No public members in abstract class 在C#中,如何使用不同程序集中的公共类成员(方法或变量) - In C#, How Can I Use Public Class Members(Methods Or Variables) From Different Assembly 由于没有默认构造函数,因此无法创建实例,但是只有可用的构造函数不是公共的。 如何从课堂上召集公众成员? - Can't create instance since no default constructor, but only available constructor is not public. How to call public members from class? 如何在派生类中调用,访问基类的公共成员 - How to invoke, access public members of base class in derived class 如何访问片段类中MainActivity类的公共成员(变量或方法) - how to access public Members(variable or method) of MainActivity class in fragment class 访问公共嵌套类的成员 - Access to members of a nested class that are public 内部课程中的公共和内部成员? - Public and Internal members in an Internal class? Visual Studio如何检查接口中是否定义了所有公共类 - Visual Studio How To Check if all public members of Class are defined in Interface 如何在运行时从JSON / XML序列中排除数据成员 - How to exclude data members from JSON/XML serialization during runtime 如何从解决方案范围内排除某些程序集/类/方法/任何内容? - How to exclude certain assembly/class/method/whatever from solution-wide-aspect?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM