Doxygen 如何从通用接口中的重写方法继承文档?
我有一个接口 Collection
,以及一个实现该接口 Movies 实现 Collection
的类。该接口有几个用于排序的抽象方法,这些方法被 Movies 覆盖。
我想知道的是,如何让 Doxygen 使用 Movies 类中 Collection.sort() 和 Collection.safeSort() 的文档?了解这一点很有用,因为这样我就可以编写接口的文档,而不是接口的每个实现。如果我可以为重写的方法添加文档,那就太好了,但这并不是 100% 必要的。
顺便说一句,INHERIT_DOCS
设置为 YES
,我相信 Doxygen 正在挣扎,因为它实现了 Collection
而不是 Collection
。
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>
.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
似乎有许多针对 doxygen 的错误与此类行为相关,请参阅以下示例:
对于解决方法,您可以使用 @copydoc 将基类中的文档引入派生类中,类似于:
这将允许基类中的文档出现在派生类文档中,而无需复制它。
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:
This will allow the documentation in the base class to appear to in the derived class documentation without having to copy it.