简体   繁体   English

javadoc和包的私有接口?

[英]javadoc and package private interface?

This maybe the same issue with How can I prevent a package-private interface appearing in Javadoc? 如何防止Javadoc中出现程序包专用接口可能与此问题相同 . But I thing the situation is a little bit different. 但是我觉得情况有些不同。

interface Child<P> { // package-private!!! internal-use only!!!
    P getParent();
    void setParent(P parent);
}

public class John implements Child<Jane> {
}

When I generate the javadoc, I see following definitions on John's page. 生成Javadoc时,我在John的页面上看到以下定义。

getParent
    public P getParent()
setParent
    public void setParent(P parent)

Is this normal? 这正常吗? Is there any way to hide those methods defined in the package-private interface? 有什么方法可以隐藏那些在package-private接口中定义的方法吗?

from the JavaTutorials : JavaTutorials

The interface body can contain abstract methods, default methods, and static methods. 接口主体可以包含抽象方法,默认方法和静态方法。 An abstract method within an interface is followed by a semicolon, but no braces (an abstract method does not contain an implementation). 接口内的抽象方法后跟分号,但不使用花括号(抽象方法不包含实现)。 Default methods are defined with the default modifier, and static methods with the static keyword. 默认方法使用default修饰符定义,静态方法使用static关键字定义。 All abstract, default, and static methods in an interface are implicitly public , so you can omit the public modifier. 接口中的所有抽象,默认和静态方法都隐式为public ,因此您可以省略public修饰符。

Take a look at this link to see if the provided approach helps you to hide the desired methods of the javadoc. 查看此链接,以查看提供的方法是否可以帮助您隐藏所需的javadoc方法。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM