Verbose output is enabled using the -verbose2 flag.

This commit is contained in:
Diomidis Spinellis 2006-02-04 23:03:31 +00:00
parent d04ac049c7
commit 18604f7165
6 changed files with 33 additions and 13 deletions

View File

@ -92,6 +92,10 @@ Disabled by default, since it does not work properly if there are multiple
classes in the same source file (will add dependencies to every class in
the source file).
</dd>
<dt>-verbose2</dt><dd>Will print on the standard output details regarding
the progress of graph generation.
(Note that -verbose is a javadoc option with a different meaning).
</dd>
<dt>-collpackages</dt><dd>Specify the classes that will be treated as
containers for one to many relationships when inference is enabled.
Matching is done using a non-anchored regular match. Empty by default.

View File

@ -68,6 +68,7 @@ class Options implements Cloneable, OptionProvider {
boolean inferRelationships;
boolean inferDependencies;
boolean useImports;
boolean verbose2;
String inferRelationshipType;
private Vector<Pattern> collPackages;
@ -102,6 +103,7 @@ class Options implements Cloneable, OptionProvider {
inferRelationships = false;
inferDependencies = false;
useImports = false;
verbose2 = false;
inferRelationshipType = "navassoc";
collPackages = new Vector<Pattern>();
}
@ -119,7 +121,7 @@ class Options implements Cloneable, OptionProvider {
return clone;
}
/** Most verbose output */
/** Most complete output */
public void setAll() {
showAttributes = true;
showEnumerations = true;
@ -150,6 +152,7 @@ class Options implements Cloneable, OptionProvider {
option.equals("-views") ||
option.equals("-inferrel") ||
option.equals("-useimports") ||
option.equals("-verbose2") ||
option.equals("-inferdep"))
return 1;
@ -178,7 +181,7 @@ class Options implements Cloneable, OptionProvider {
return 0;
}
/** Set the options based on a lingle option and its arguments */
/** Set the options based on a single option and its arguments */
void setOption(String[] opt) {
if(!opt[0].equals("-hide") && optionLength(opt[0]) > opt.length) {
System.err.println("Skipping option '" + opt[0] + "', missing argument");
@ -328,6 +331,8 @@ class Options implements Cloneable, OptionProvider {
inferDependencies = false;
} else if(opt[0].equals("-useimports")) {
useImports = true;
} else if(opt[0].equals("-verbose2")) {
verbose2 = true;
} else if(opt[0].equals("-!useimports")) {
useImports = false;
} else if (opt[0].equals("-collpackages")) {

View File

@ -42,10 +42,11 @@ import com.sun.javadoc.RootDoc;
public class UmlGraph {
/** Entry point */
public static boolean start(RootDoc root) throws IOException {
System.out.println("UMLGraph doclet started");
Options opt = new Options();
opt.setOptions(root.options());
opt.setOptions(findUMLOptions(root));
if (opt.verbose2)
System.out.println("UMLGraph doclet started");
View[] views = buildViews(opt, root);
if(views == null)
@ -58,7 +59,8 @@ public class UmlGraph {
}
}
System.out.println("Class diagram generation complete");
if (opt.verbose2)
System.out.println("Class diagram generation complete");
return true;
}
@ -75,8 +77,9 @@ public class UmlGraph {
* Builds and outputs a single graph according to the view overrides
*/
private static void buildGraph(RootDoc root, OptionProvider op) throws IOException {
System.out.println("Building " + op.getDisplayName());
Options opt = op.getGlobalOptions();
if (opt.verbose2)
System.out.println("Building " + op.getDisplayName());
ClassDoc[] classes = root.classes();
ClassGraph c = new ClassGraph(root, op);

View File

@ -68,6 +68,7 @@ class Options implements Cloneable, OptionProvider {
boolean inferRelationships;
boolean inferDependencies;
boolean useImports;
boolean verbose2;
String inferRelationshipType;
private Vector<Pattern> collPackages;
@ -102,6 +103,7 @@ class Options implements Cloneable, OptionProvider {
inferRelationships = false;
inferDependencies = false;
useImports = false;
verbose2 = false;
inferRelationshipType = "navassoc";
collPackages = new Vector<Pattern>();
}
@ -119,7 +121,7 @@ class Options implements Cloneable, OptionProvider {
return clone;
}
/** Most verbose output */
/** Most complete output */
public void setAll() {
showAttributes = true;
showEnumerations = true;
@ -150,6 +152,7 @@ class Options implements Cloneable, OptionProvider {
option.equals("-views") ||
option.equals("-inferrel") ||
option.equals("-useimports") ||
option.equals("-verbose2") ||
option.equals("-inferdep"))
return 1;
@ -178,7 +181,7 @@ class Options implements Cloneable, OptionProvider {
return 0;
}
/** Set the options based on a lingle option and its arguments */
/** Set the options based on a single option and its arguments */
void setOption(String[] opt) {
if(!opt[0].equals("-hide") && optionLength(opt[0]) > opt.length) {
System.err.println("Skipping option '" + opt[0] + "', missing argument");
@ -328,6 +331,8 @@ class Options implements Cloneable, OptionProvider {
inferDependencies = false;
} else if(opt[0].equals("-useimports")) {
useImports = true;
} else if(opt[0].equals("-verbose2")) {
verbose2 = true;
} else if(opt[0].equals("-!useimports")) {
useImports = false;
} else if (opt[0].equals("-collpackages")) {

View File

@ -42,10 +42,11 @@ import com.sun.javadoc.RootDoc;
public class UmlGraph {
/** Entry point */
public static boolean start(RootDoc root) throws IOException {
System.out.println("UMLGraph doclet started");
Options opt = new Options();
opt.setOptions(root.options());
opt.setOptions(findUMLOptions(root));
if (opt.verbose2)
System.out.println("UMLGraph doclet started");
View[] views = buildViews(opt, root);
if(views == null)
@ -58,7 +59,8 @@ public class UmlGraph {
}
}
System.out.println("Class diagram generation complete");
if (opt.verbose2)
System.out.println("Class diagram generation complete");
return true;
}
@ -75,8 +77,9 @@ public class UmlGraph {
* Builds and outputs a single graph according to the view overrides
*/
private static void buildGraph(RootDoc root, OptionProvider op) throws IOException {
System.out.println("Building " + op.getDisplayName());
Options opt = op.getGlobalOptions();
if (opt.verbose2)
System.out.println("Building " + op.getDisplayName());
ClassDoc[] classes = root.classes();
ClassGraph c = new ClassGraph(root, op);

View File

@ -1,15 +1,15 @@
@echo off
rem @echo off
rem Run UMLGraph on the specified base file name
rem $Id$
if not "%2" == "" goto ok
echo usage: umlgraph base_file_name filetype
echo usage: umlgraph base_file_name filetype [umlgraph arguments]
goto end
:ok
javadoc -docletpath lib/UmlGraph.jar -doclet gr.spinellis.umlgraph.doclet.UmlGraph -private -output %1.dot %1.java
javadoc -docletpath lib/UmlGraph.jar -doclet gr.spinellis.umlgraph.doclet.UmlGraph -private %3 %4 %5 %6 %7 %8 %9 -output %1.dot %1.java
dot -T%2 -o%1.%2 %1.dot
:end