| 1 | package UML::Sequence::JavaSeq; | ||||||||||
| 2 | 1 | ▶ | use UML::Sequence::SimpleSeq; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 3 | |||||||||||
| 4 | 1 | @ISA = ('UML::Sequence::SimpleSeq'); | |||||||||
| 5 | 1 | $VERSION = '0.02'; | |||||||||
| 6 | |||||||||||
| 7 | 1 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 8 | 1 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 9 | |||||||||||
| 10 | =head1 NAME | ||||||||||
| 11 | |||||||||||
| 12 | UML::Sequence::JavaSeq - for use with genericseq.pl script, works on compiled Java programs | ||||||||||
| 13 | |||||||||||
| 14 | =head1 SYNOPSIS | ||||||||||
| 15 | |||||||||||
| 16 | genericseq.pl UML::Sequence::JavaSeq Hello.methods Hello > Hello.xml | ||||||||||
| 17 | seq2svg.pl Hello.xml > Hello.svg | ||||||||||
| 18 | |||||||||||
| 19 | OR | ||||||||||
| 20 | |||||||||||
| 21 | genericseq.pl UML::Sequence::JavaSeq Hello.methods Hello | seq2svg.pl > Hello.svg | ||||||||||
| 22 | |||||||||||
| 23 | =head1 DESCRIPTION | ||||||||||
| 24 | |||||||||||
| 25 | This file depends on L<UML::Sequence::SimpleSeq> and a Java tool called | ||||||||||
| 26 | Seq.java. The later produces an outline of the calls to methods named | ||||||||||
| 27 | in Hello.methods. The former provides methods L<UML::Sequence> needs to produce | ||||||||||
| 28 | an xml sequence. Look in the provided Hello.methods to see what options | ||||||||||
| 29 | you have for controlling output. | ||||||||||
| 30 | |||||||||||
| 31 | For this class to work, you must have Seq.class (and its friends) and | ||||||||||
| 32 | tools.jar (the one containing the the jpda) in your class path. Your | ||||||||||
| 33 | jpda must be happy. (The jpda is the Java Platform Debugger Architecture. | ||||||||||
| 34 | It ships with java 1.3.) | ||||||||||
| 35 | |||||||||||
| 36 | =head1 grab_outline_text | ||||||||||
| 37 | |||||||||||
| 38 | Call this method through the class name with the method file, the class | ||||||||||
| 39 | you want to sequence, and any arguments that class's main method needs. | ||||||||||
| 40 | Returns an outline you can pass to UML::Sequence::SimpleSeq->grab_methods | ||||||||||
| 41 | and to the UML::Sequence constructor. | ||||||||||
| 42 | |||||||||||
| 43 | =cut | ||||||||||
| 44 | |||||||||||
| 45 | 0 | ▶ | sub grab_outline_text { | ||||||||
|
Subroutine
grab_outline_text: not called CC=3 SCAR=24.8
Pod
undocumented
| |||||||||||
| 46 | 0 | shift; # discard class name | |||||||||
| 47 | 0 | my @retval; | |||||||||
| 48 | 0 | my $method_file = shift; | |||||||||
| 49 | |||||||||||
| 50 | 0 | `java Seq $method_file SEQ.TMP @_ > /dev/null`; | |||||||||
| 51 | |||||||||||
| 52 | 0 | ▶ | open SEQ, "SEQ.TMP" or die "Couldn't run java Seq: $!\n"; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 53 | 0 | ▶ | while (<SEQ>) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 54 | 0 | push @retval, $_; | |||||||||
| 55 | } | ||||||||||
| 56 | 0 | close SEQ; | |||||||||
| 57 | |||||||||||
| 58 | 0 | unlink "SEQ.TMP"; | |||||||||
| 59 | 0 | return \@retval; | |||||||||
| 60 | } | ||||||||||
| 61 | |||||||||||
| 62 | 1 | 1; | |||||||||