问题描述
我遇到了一个问题,即Doxygen在文档中不包括非静态Java通用方法。找不到使用以下语法的方法:
I'm running into an issue where Doxygen does not include non-static Java generic methods in the documentation. Methods using the following syntax are not found:
public <T> ReturnType<T> methodName(ArgType1 arg1, ArgType2<T> arg2) throws Exception{}
但是,以下方法声明都可以找到并包含在文档中:
However, the following method declarations are both found and included in the documentation:
public static <T> ReturnType<T> methodName(ArgType1 arg1, ArgType2<T> arg2) throws Exception{}
public ReturnType<T> methodName(ArgType1 arg1, ArgType2<T> arg2) throws Exception{}
是否还有其他人遇到此问题?
Has anyone else encountered this issue?
推荐答案
我也遇到过它。在我看来,Doxygen不支持Java通用方法(至少在此特定版本中-我使用1.8.8-5),因此被忽略了。 static
覆盖了此行为,因为它显然使Doxygen接受任意字符串作为返回类型修饰符。
I have encountered it, too. Seems to me, that Java Generic Methods are not supported in Doxygen (at least in this particular version - I use 1.8.8-5) and thus ignored. static
overrides this behavior, as it apparently makes Doxygen accept arbitrary strings as return type modifiers.
环绕第一个< T>
和 / *! @cond x * /
和 / *! @endcond * /
,因此即使它很丑陋,Doxygen也会忽略它(x可以是任何字符串,只要它不标记启用条件即可)。
Surrounding the first <T>
with /*! @cond x */
and /*! @endcond */
, so it is ignored by Doxygen, helps, even though it's ugly (x can be any string, as long as it doesn't label an enabled condition).
这篇关于Doxygen失去了非静态Java通用方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!