The tag '@sequence.diagram' has to be placed into the JavaDoc description of a method to generate a sequence diagram for this method and to link it as documentation into the JavaDoc html output.
The sequence diagram is generated dynamically based on the execution of the method. Dynamic method tracing is accomplished in JSeqUnit with the help of JUnit tests. Thus, a test has to be specified, which executes the method to be documented.
Given a Java class net.sf.jsequnit.example.SequenceSample containing a JavaDoc tag for sequence diagram generation:
/** * @sequence.diagram test=net.sf.jsequnit.example.SequenceSampleTest#testSimpleSequenceDiagram() */ public void simpleSequenceDiagram()
when JSeqUnit is executed with the following JavaDoc command
javadoc -taglet net.sf.jsequnit.javadoc.SequenceTaglet -tagletpath target/classes;target/test-classes;target/jsequnit-2.0.jar;target/lib/junit-4.10.jar;target/lib/jseq-0.6.jar;target/lib/sdedit-light-3.1.jar -sourcepath src/site/example/main -d target/test-dir net.sf.jsequnit.example
a sequence diagram is generated and placed into the sub-directory relative to the path of the JavaDoc file of the class
target/test-dir/net/sf/jsequnit/example/sequence-diagrams/SequenceSample-simpleSequenceDiagram_testSimpleSequenceDiagram.png
and the following image link is added to the JavaDoc of the method description:
<img src="sequence-diagrams/SequenceSample-simpleSequenceDiagram_testSimpleSequenceDiagram.png"/>