简体   繁体   中英

javadoc and package private interface?

This maybe the same issue with How can I prevent a package-private interface appearing in 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.

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?

from the 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.

Take a look at this link to see if the provided approach helps you to hide the desired methods of the javadoc.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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