Doxygen如何从通用接口中的overriden方法继承文档? [英] Doxygen how to inherit documents from overriden methods in a generic interface?

查看:173
本文介绍了Doxygen如何从通用接口中的overriden方法继承文档?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个接口 Collection< T extends Item> ,以及一个实现该接口的类 Movies实现了Collection< Movie> 。该接口有一些抽象方法用于被电影覆盖的排序。



我想知道的是,我如何让Doxygen使用Collection中的文档。类Movies中的sort()和Collection.safeSort()?知道这一点很有用,因为我可以为接口编写文档,而不是每个接口的实现。如果我可以对重写的方法添加文档,那就太棒了,但这不是100%的必要。

INHERIT_DOCS 被设置为 YES 顺便说一下,我相信Doxygen正在挣扎,因为它实现了 Collection< Movie> 并且不是集合< T extends Item>

解决方案

一些针对与此类行为相关的doxygen提交的错误,请参阅以下示例:



For一个解决方法,你可以使用@copydoc将你的基类中的文档引入到你的派生类中,如: **
*电影
* /
公共课程电影延伸收藏<电影> {
/ **
* @copydoc集合< T扩展项目> :: sort()
*
*特定于Movies :: sort()的其他文档。
* /
public void sort(void){return; }
}

这将允许基类中的文档出现在派生不需要复制它的类文档。


I have an interface Collection<T extends Item>, and a class that implements that interface Movies implements Collection<Movie>. The interface has a couple of abstract methods for sorting that are overriden by Movies.

What I want to know is, how can I get Doxygen to use the documentation from Collection.sort() and Collection.safeSort() in the class Movies? It'd be useful to know because then I can write the documentation for the interface, rather than each implementation of the interface. If I could -add- documentation to the overridden methods, that would be great, but that's not 100% necessary.

INHERIT_DOCS is set to YES by the way, I believe Doxygen is struggling because it implements Collection<Movie> and not Collection<T extends Item>.

解决方案

There appear to be a number of bugs filed against doxygen related to this type of behavior, see the following for some examples:

For a workaround, you could use @copydoc to bring the documentation in your base class in to your derived class, something like:

/**
 * Movies
 */
public class Movies extends Collection<Movie> {
    /**
     * @copydoc Collection<T extends Item>::sort()
     *
     * Additional documentation specific to Movies::sort().
     */
    public void sort(void) { return; }
}

This will allow the documentation in the base class to appear to in the derived class documentation without having to copy it.

这篇关于Doxygen如何从通用接口中的overriden方法继承文档?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆