How can I generate sequence diagrams from Java source code?

pavan picture pavan · Nov 22, 2011 · Viewed 15.7k times · Source

Is there any command line tool which takes Java source and generates sequence diagrams? Or are there any tools that convert Java code to XML and convert the XML to sequence diagrams in any of the standard image format using open api ? i know some tools which generate sequence diagrams from text description such as uml graph. is there any way to convert java code to text description format.so that i can use the available tools.

Answer

Stewart picture Stewart · Oct 31, 2012

Quick Sequence Diagram Editor works off simple text files.

Perhaps you could use this in combination with Eclipse:

  1. Highlight a method name in your editor window
  2. Right-Click, select "Open Call Hierarchy"
  3. In the "Call Hierarchy" window which opens, expand the stack path elements you want
  4. Select the top-level stack element
  5. Right-Click, select "Copy Expanded Hierarchy"
  6. Paste into a text editor of your choice (Vi, Nano, Notepad++, etc)
  7. Use some text conversion / regex utility to convert to Quick Sequence Diagram Editor text format.