Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Automatic properties documentation for Java application

Are there "Javadoc-like" instruments for configuration properties in Java application?

I'm currently working on Java application, which uses usual Java properties files for configuration. 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. It would be helpful to have something similar for properties.

like image 733
Evgeney Kuznetsov Avatar asked Sep 13 '16 10:09

Evgeney Kuznetsov


People also ask

What is Java application properties?

Most Java application need to use properties at some point, generally to store simple parameters as key-value pairs, outside of compiled code. And so the language has first class support for properties – the java. util. Properties – a utility class designed for handling this type of configuration files.

How read properties file in Java application?

Each key and its corresponding value in the property list is a string. The Properties file can be used in Java to externalize the configuration and to store the key-value pairs. The Properties. load() method of Properties class is convenient to load .


1 Answers

You can use PropDoc for properties file Document generation. PropDoc is a utility that aims to improve the documentability of Java Properties files.

It can read in a standard Java Properties file and parse JavaDoc-like annotations out of the comments of properties. 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. 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 is ready tool which can be used for property file generation. You can also create your own by referring it's source.

like image 125
Abhijeet Avatar answered Oct 11 '22 19:10

Abhijeet