4

Trying to see if there is a tool to capture flow within a single Java method in a diagram.

Consider for example

public void getXXX(String y, String z) {
   if (y.equals("proceed")) {
      ....
   }
   else {
     if (z.equals("proceed")) {
       ....
     }
     else {
      ....
     }
      ----do some processing
   }

}

I am looking for tool that would convert the flow within this method getXXX to a diagram.

A) I am not familiar with UML, normally we use flowcharts. Is there an equivalent diagram in UML. - activity?

B) Based on the results given by A) - is it possible in Eclipse to generate that diagram from CODE. C) If it is not possible to generate using Eclipse, are there any tools that will take the CODE and generate the specified diagram

Forum Member
  • 163
  • 1
  • 6
  • 15

3 Answers3

0

Take a look at these two tools:
1. Code Rocket For Eclipse
2. codeswat.com

hitz
  • 1,100
  • 8
  • 12
  • Thank you for the reply. Which diagram in UML gives the flow within a method. – Forum Member May 12 '15 at 20:43
  • 1
    [`Activity Diagrams`](http://en.wikipedia.org/wiki/Activity_diagram) in UML provide similar notations to flowcharts and are preferred over them as they have more standard notation. – hitz May 12 '15 at 20:53
0

The fUML spec from the OMG maps activities to Java. I think it also goes the other direction. There is an open source reference implementation available. Activity diagrams are what you are looking for. Moreover, you may want to look into ALF, which is a more powerful language that is isomorphic with UML activities. With ALF, you must go out of your way to serialize control flow in your program. That's pretty cool. It also has an open source reference implementation.

Jim L.
  • 6,177
  • 3
  • 21
  • 47
0

I think you can look for a tool to visualize the Cyclomatic Complexity or Static code analyzers.

Checkout Eclipse Source Code Analyzers like ModelGoon UML4Java.

And here is another similar question: Static analysis of Java call graph.

Community
  • 1
  • 1
Jahan Zinedine
  • 14,616
  • 5
  • 46
  • 70