jLuger.de - Custom javadoc

In the current JavaMagazin is an article about SOPlets. There the mention the principle of Single Source of Truth (SSoT) where every information is only stored at one place. I liked the idea because it seems avoids redundancy which makes maintenance difficult. On the other side I've feared that it will be difficult to implement. Well, right a few days after reading the article I was confronted with SSoT in one of my projects. I had to create a documentation of our database schema for a privacy policy review. Of course we had done an extensive documentation but it was in the javadoc of our JPA POJOs.

My first approach was to make a copy&paste from the javadoc to a word file. While I was wondering whether I should take the javadoc from the source code or the generated HTML javadoc I remembered two things: SSoT and that you can format the output of the javadoc tool via custom Doclets.

With the help of the Doclet overview and the Doclet API I was able to extract all information about our database schema in format that I could easily paste into a word document without any extensive post formating. While it did the job I have to say that it wasn't the time save as I expected it. The fine tuning and output correction took a loot of time. So when you are sure that you need to extract information only once and/or your javadoc isn't very consistent you better do manual extraction (and pray that you don't need to maintain the document).

Lessons learned: