这可能与How can I prevent a package-private interface appearing in Javadoc?有同样的问题。 但我认为情况有点不同。
interface Child<P> { // package-private!!! internal-use only!!!
P getParent();
void setParent(P parent);
}
public class John implements Child<Jane> {
}
当我生成 javadoc 时,我在 John 的页面上看到以下定义。
getParent
public P getParent()
setParent
public void setParent(P parent)
这正常吗?有什么方法可以隐藏包私有(private)接口(interface)中定义的那些方法吗?
最佳答案
来自 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. All abstract, default, and static methods in an interface are implicitly public, so you can omit the public modifier.
看看这个 link看看提供的方法是否可以帮助您隐藏 javadoc 所需的方法。
关于javadoc 和包私有(private)接口(interface)?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33704498/