简体   繁体   English

方法在JavaDoc中列出两次

[英]Method listed twice in JavaDoc

I have two classes and two interfaces. 我有两个类和两个接口。 InterfaceA

package ch.sukha.testmachine.client;
interface InterfaceA {
    /**
     * Foo.
     */
    void foo();
}

is the super interface of InterfaceB . InterfaceB的超级InterfaceB

package ch.sukha.testmachine.client;
public interface InterfaceB extends InterfaceA {
   /**
    * Bar.
    */
   void bar();
}

Likewise, class A is the super class of 同样, A类是

package ch.sukha.testmachine.client;
class A implements InterfaceA {
    @Override
    public void foo() {
    }
}

class B . B级。

package ch.sukha.testmachine.client;
public class B extends A implements InterfaceB {
    @Override
    public void bar() {
    }
}

In the generated JavaDoc, method foo appears twice. 在生成的JavaDoc中,方法foo出现两次。

在此处输入图片说明

A is not exported. A未导出。 I want to create multiple subclasses of A and reuse the documentation of InterfaceA. 我想创建A的多个子类并重用InterfaceA的文档。

Export everything to JavaDoc. 将所有内容导出到JavaDoc。

To reuse parts of it, you can use the 要重用其中的一部分,您可以使用

@inheritDoc 

annotation. 注解。

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

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