将javadoc中的@value与data.properties文件一起使用

将javadoc中的@value与data.properties文件一起使用,java,intellij-idea,documentation,javadoc,Java,Intellij Idea,Documentation,Javadoc,我使用Javadoc来编写文档。现在我有一个类似这样的东西 /** * Test Doco * */ public class testClass() { public void testMethod() { /** More test doco */ customFunction() } } 我还有一个非常简单的data.properties文件: basic.entry=test second.entry=test2 th

我使用Javadoc来编写文档。现在我有一个类似这样的东西

/**
* Test Doco
*
*/
public class testClass() {
    public void testMethod() {
        /** More test doco
        */

        customFunction() 
    }
}
我还有一个非常简单的data.properties文件:

basic.entry=test
second.entry=test2
third.entry=test3
我想知道是否有一种方法可以链接我的Javadoc以从data.properties文件中提取值

我试过:

/** 
* {@value /properties/data.properties#basic.entry)
*/

JavaDoc规范和IntelliJ IDEA都不支持来自外部文件的值。

您可以编写自己的JavaDoc预处理器来扫描代码中的特殊标记,并将它们引用的任何文件或您需要的任何文件中的值作为有效的JavaDoc注释插入,然后对代码运行JavaDoc工具。 例如:

您的预处理器可以读取文件,生成所需的值,并用以下内容替换JavaDoc的第一行(或任何内容)之后的所有内容:

/**
* The values from the file are:
* basic.entry=test,
* second.entry=test2,
* third.entry=test3
*/
//[filetocsv /properties/data.properties#basic.entry]
现在JavaDoc可以扫描您的代码并生成HTML文档。 很简单。这样做不需要太多工作

/**
* The values from the file are:
* basic.entry=test,
* second.entry=test2,
* third.entry=test3
*/
//[filetocsv /properties/data.properties#basic.entry]