Writing proper javadoc with @see?

后端 未结 1 1957
醉酒成梦
醉酒成梦 2021-02-02 15:13

How do I use the @see javadoc properly?

My intention is to have an abstract class with abstract methods. These methods have javadoc comments. Now if I exten

相关标签:
1条回答
  • 2021-02-02 15:29

    For the purpose of including the documentation from a superclass you should use {@inheritDoc} not @see.

    Then you get the docs of the superclass. You can add to it, and you can override stuff like @param and @return if you need to.

    public abstract class MyBase {
      /**
       * @param id The id that will be used for...
       * @param good ignored by most implementations
       * @return The string for id
       */
      protected abstract String myFunc(Long id, boolean good);
    }
    
    class MyImpl extends MyBase {
    
      /**
       * {@inheritDoc}
       * @param good is used differently by this implementation
       */
      @Override
      protected String myFunc(Long id, boolean good) { .. }
    }
    
    0 讨论(0)
提交回复
热议问题