简体   繁体   English

Java应用程序的自动属性文档

[英]Automatic properties documentation for Java application

Are there "Javadoc-like" instruments for configuration properties in Java application? 在Java应用程序中是否有用于配置属性的“类Javadoc”工具?

I'm currently working on Java application, which uses usual Java properties files for configuration. 我目前正在研究Java应用程序,它使用通常的Java属性文件进行配置。 This is an "enterprise app", so we have dozens of properties and it's really difficult to support documentation for them. 这是一个“企业应用程序”,所以我们有很多属性,而且很难为它们提供文档支持。

So I want to find a tool or framework which makes it possible to describe properties in code, for example with annotations, and then export the documentation to a file. 所以我想找到一个工具或框架,它可以在代码中描述属性,例如使用注释,然后将文档导出到文件中。

We already use Javadoc and Swagger for documentation - it's quite convenient. 我们已经使用Javadoc和Swagger作为文档 - 它非常方便。 It would be helpful to have something similar for properties. 为属性提供类似的东西会很有帮助。

You can use PropDoc for properties file Document generation. 您可以将PropDoc用于属性文件文档生成。 PropDoc is a utility that aims to improve the documentability of Java Properties files. PropDoc是一个旨在提高Java Properties文件可记录性的实用程序。

It can read in a standard Java Properties file and parse JavaDoc-like annotations out of the comments of properties. 它可以读取标准的Java Properties文件,并从属性的注释中解析类似JavaDoc的注释。 Result is a meta-model that can be used to generate documentation about the properties in the file. 结果是一个元模型,可用于生成有关文件中属性的文档。

There is default template which will generate your document in HTML format. 有一个默认模板,它将生成HTML格式的文档。 You can customize that template according to your need. 您可以根据需要自定义该模板。 Its very basic and easy to use. 它非常基本且易于使用。

You can refer and get code from here PropDoc . 您可以从PropDoc中引用并获取代码。

PropDoc is ready tool which can be used for property file generation. PropDoc是现成的工具,可用于生成属性文件。 You can also create your own by referring it's source. 您也可以通过引用它来创建自己的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM