English 中文(简体)
Generate class diagram from existing javadocs
原标题:
  • 时间:2009-12-08 16:49:03
  •  标签:
  • uml
  • javadoc

I m using an external java library for which I only have the javadocs and do not have the source code. I d like to generate a UML diagram from the existing javadocs so that I can visualize the class hierarchy using something like Graphviz. Is that possible? Note that what I m looking for is a graphical version of overview-tree.html.

Please let me know if you have any ideas and/or suggestions.

Thanks,

Shirley

问题回答

I don t believe that there is such a tool. Most of the reverse engineer tools depend on the actual code. The javadoc information isn t guaranteed to match the code as a 1:1 for the structure, thus making it unreliable.

I m not familiar with any off-the-shelf solution for this purpose. Most commonly folks have the source code that generated the JavaDoc.

That being said, the overview-tree.html traditionally has a fairly straightforward HTML format. It should not be difficult to write a script that would read the file as text or as a DOM, reconstruct the hierarchy of UL and LI tags, and use that to build an input file for graphviz. I ve done similar stuff in the past with other forms of data.

It s just a matter of time and proficiency with the scripting language or appropriate tools.

The one problem of this approach is that you would only get the hierarchy of classes. You would have to make it somewhat smarter if you wanted to get the "implements XYZ" and create multiple hierarchies. Even if you could get that data, you would have to manipulate GraphViz s levels to get it to provide an appropriate layout once you have this multiple inheritance structure.

Of course, adding the details of the members would turn this into a whole new problem since you will have to access other HTML files.





相关问题
Generate class diagram from existing javadocs

I m using an external java library for which I only have the javadocs and do not have the source code. I d like to generate a UML diagram from the existing javadocs so that I can visualize the class ...

Should JUnit tests be javadocced?

I have a number of JUnit test cases that are currently not documented with Javadoc comments. The rest of my code is documented, but I m wondering if it s even worth the effort to document these tests....

Does Javadoc have an equivalent to <![CDATA[ ... ]]>?

Unfortunately, there is no CDATA in HTML. This is a pity, because it would be perfect for adding javadoc comments that include XML, so you don t have to escape the < and >, for example: /**<![...

javadoc: show also descriptions of methods from parent class

Is there a way to produce javadoc so that all methods accessible from the class are listed with their full description? Usually only the methods defined in that class are listed and the rest are only ...

Is there a central javadoc repository online?

I found some sample code that uses an interface named com.sun.jersey.spi.container.ContainerRequestFilter. Someone was nice enough to post the javadoc here, but it just looks like it was some ...

热门标签