mirror of https://github.com/dspinellis/UMLGraph
Add -hideGenerics option.
This commit is contained in:
parent
dc18c503e9
commit
7169d40228
|
|
@ -131,6 +131,8 @@ class ClassGraph {
|
|||
|
||||
/** Return the class's name, possibly by stripping the leading path */
|
||||
private static String qualifiedName(Options opt, String r) {
|
||||
if (opt.hideGenerics)
|
||||
r = removeTemplate(r);
|
||||
// Nothing to do:
|
||||
if (opt.showQualified && (opt.showQualifiedGenerics || r.indexOf('<') < 0))
|
||||
return r;
|
||||
|
|
@ -183,7 +185,7 @@ class ClassGraph {
|
|||
private String type(Options opt, Type t, boolean generics) {
|
||||
return ((generics ? opt.showQualifiedGenerics : opt.showQualified) ? //
|
||||
t.qualifiedTypeName() : t.typeName()) //
|
||||
+ typeParameters(opt, t.asParameterizedType());
|
||||
+ (opt.hideGenerics ? "" : typeParameters(opt, t.asParameterizedType()));
|
||||
}
|
||||
|
||||
/** Print the parameters of the parameterized type t */
|
||||
|
|
|
|||
|
|
@ -57,6 +57,7 @@ public class Options implements Cloneable, OptionProvider {
|
|||
List<Pattern> includePatterns = new ArrayList<Pattern>();
|
||||
boolean showQualified = false;
|
||||
boolean showQualifiedGenerics = false;
|
||||
boolean hideGenerics = false;
|
||||
boolean showAttributes = false;
|
||||
boolean showEnumerations = false;
|
||||
boolean showEnumConstants = false;
|
||||
|
|
@ -190,6 +191,7 @@ public class Options implements Cloneable, OptionProvider {
|
|||
public static int optionLength(String option) {
|
||||
if(matchOption(option, "qualify", true) ||
|
||||
matchOption(option, "qualifyGenerics", true) ||
|
||||
matchOption(option, "hideGenerics", true) ||
|
||||
matchOption(option, "horizontal", true) ||
|
||||
matchOption(option, "attributes", true) ||
|
||||
matchOption(option, "enumconstants", true) ||
|
||||
|
|
@ -265,6 +267,8 @@ public class Options implements Cloneable, OptionProvider {
|
|||
showQualified = positive;
|
||||
} else if(matchOption(opt[0], "qualifyGenerics", true)) {
|
||||
showQualifiedGenerics = positive;
|
||||
} else if(matchOption(opt[0], "hideGenerics", true)) {
|
||||
hideGenerics = positive;
|
||||
} else if(matchOption(opt[0], "horizontal", true)) {
|
||||
horizontal = positive;
|
||||
} else if(matchOption(opt[0], "attributes", true)) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue