From fb49bafe0fb68dbceab001ffb2c3ac7b899dad25 Mon Sep 17 00:00:00 2001 From: Andrea Aime Date: Sun, 11 Jun 2006 13:45:55 +0000 Subject: [PATCH] Added two options: - a way to avoid seeing intra-package dependencies between classes since classes in the same package are supposed to be releated anyway and in fact, there's no reliable way to spot all of them anyway (since you don't need imports for using classes in the same package) - a way to limit the visibility of members used to perform dependency inference. Both of these allow to reduce the "fur ball" effect. Finally, removed the -version2 option since we can rely on the -quiet standard javadoc option if we use RootDoc.printNotice/Warning/Error --- src/gr/spinellis/umlgraph/doclet/Options.java | 26 +++++++++++++++---- src/org/umlgraph/doclet/Options.java | 26 +++++++++++++++---- 2 files changed, 42 insertions(+), 10 deletions(-) diff --git a/src/gr/spinellis/umlgraph/doclet/Options.java b/src/gr/spinellis/umlgraph/doclet/Options.java index fde451b..ff855e4 100644 --- a/src/gr/spinellis/umlgraph/doclet/Options.java +++ b/src/gr/spinellis/umlgraph/doclet/Options.java @@ -110,6 +110,8 @@ public class Options implements Cloneable, OptionProvider { boolean inferRelationships; boolean inferDependencies; boolean useImports; + Visibility inferDendencyVisibility; + boolean inferDepInPackage; boolean verbose2; String inferRelationshipType; private Vector collPackages; @@ -121,7 +123,7 @@ public class Options implements Cloneable, OptionProvider { // classes outside of them (for example, class gr.spinellis.Foo // would have been hidden by the hide pattern "java.*" // TODO: consider making this standard behaviour - boolean strictMatching; + boolean strictMatching; Options() { showQualified = false; @@ -161,8 +163,9 @@ public class Options implements Cloneable, OptionProvider { viewName = null; inferRelationships = false; inferDependencies = false; + inferDendencyVisibility = Visibility.PRIVATE; + inferDepInPackage = false; useImports = false; - verbose2 = false; inferRelationshipType = "navassoc"; collPackages = new Vector(); compact = false; @@ -215,8 +218,9 @@ public class Options implements Cloneable, OptionProvider { option.equals("-views") || option.equals("-inferrel") || option.equals("-useimports") || - option.equals("-verbose2") || option.equals("-inferdep") || + option.equals("-inferdepinpackage") || + option.equals("-verbose2") || option.equals("-compact")) return 1; @@ -245,6 +249,7 @@ public class Options implements Cloneable, OptionProvider { option.equals("-d") || option.equals("-view") || option.equals("-inferreltype") || + option.equals("-inferdepvis") || option.equals("-collpackages") || option.equals("-link") ) @@ -425,14 +430,25 @@ public class Options implements Cloneable, OptionProvider { } } else if(opt[0].equals("-!inferreltype")) { inferRelationshipType = "navassoc"; + } else if(opt[0].equals("-inferdepvis")) { + Visibility vis = Visibility.parseVisibility(opt[1]); + if(vis == null) + System.err.println("Ignoring invalid visibility specification for dependency inference" + vis); + inferDendencyVisibility = Visibility.PRIVATE; + } else if(opt[0].equals("-!inferdepvis")) { + inferDendencyVisibility = Visibility.PRIVATE; + } else if(opt[0].equals("-!inferreltype")) { + inferRelationshipType = "navassoc"; } else if(opt[0].equals("-inferdep")) { inferDependencies = true; } else if(opt[0].equals("-!inferdep")) { inferDependencies = false; + } else if(opt[0].equals("-inferdepinpackage")) { + inferDepInPackage = true; + } else if(opt[0].equals("-!inferdepinpackage")) { + inferDepInPackage = 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")) { diff --git a/src/org/umlgraph/doclet/Options.java b/src/org/umlgraph/doclet/Options.java index fde451b..ff855e4 100644 --- a/src/org/umlgraph/doclet/Options.java +++ b/src/org/umlgraph/doclet/Options.java @@ -110,6 +110,8 @@ public class Options implements Cloneable, OptionProvider { boolean inferRelationships; boolean inferDependencies; boolean useImports; + Visibility inferDendencyVisibility; + boolean inferDepInPackage; boolean verbose2; String inferRelationshipType; private Vector collPackages; @@ -121,7 +123,7 @@ public class Options implements Cloneable, OptionProvider { // classes outside of them (for example, class gr.spinellis.Foo // would have been hidden by the hide pattern "java.*" // TODO: consider making this standard behaviour - boolean strictMatching; + boolean strictMatching; Options() { showQualified = false; @@ -161,8 +163,9 @@ public class Options implements Cloneable, OptionProvider { viewName = null; inferRelationships = false; inferDependencies = false; + inferDendencyVisibility = Visibility.PRIVATE; + inferDepInPackage = false; useImports = false; - verbose2 = false; inferRelationshipType = "navassoc"; collPackages = new Vector(); compact = false; @@ -215,8 +218,9 @@ public class Options implements Cloneable, OptionProvider { option.equals("-views") || option.equals("-inferrel") || option.equals("-useimports") || - option.equals("-verbose2") || option.equals("-inferdep") || + option.equals("-inferdepinpackage") || + option.equals("-verbose2") || option.equals("-compact")) return 1; @@ -245,6 +249,7 @@ public class Options implements Cloneable, OptionProvider { option.equals("-d") || option.equals("-view") || option.equals("-inferreltype") || + option.equals("-inferdepvis") || option.equals("-collpackages") || option.equals("-link") ) @@ -425,14 +430,25 @@ public class Options implements Cloneable, OptionProvider { } } else if(opt[0].equals("-!inferreltype")) { inferRelationshipType = "navassoc"; + } else if(opt[0].equals("-inferdepvis")) { + Visibility vis = Visibility.parseVisibility(opt[1]); + if(vis == null) + System.err.println("Ignoring invalid visibility specification for dependency inference" + vis); + inferDendencyVisibility = Visibility.PRIVATE; + } else if(opt[0].equals("-!inferdepvis")) { + inferDendencyVisibility = Visibility.PRIVATE; + } else if(opt[0].equals("-!inferreltype")) { + inferRelationshipType = "navassoc"; } else if(opt[0].equals("-inferdep")) { inferDependencies = true; } else if(opt[0].equals("-!inferdep")) { inferDependencies = false; + } else if(opt[0].equals("-inferdepinpackage")) { + inferDepInPackage = true; + } else if(opt[0].equals("-!inferdepinpackage")) { + inferDepInPackage = 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")) {