35 |
|
*/ |
36 |
|
public static String getName(String friendlyName, String className, String revision) { |
37 |
|
if (friendlyName == null) { |
38 |
< |
return "{"+ className + "(v" + revision.substring(11, revision.length() - 2) + ")}"; |
38 |
> |
return "{"+ tidyClassName(className) + "(v" + revision.substring(11, revision.length() - 2) + ")}"; |
39 |
|
} else if (className == null) { |
40 |
|
return friendlyName + "{static(v" + revision.substring(11, revision.length() - 2) + ")}"; |
41 |
|
} else { |
42 |
< |
return friendlyName + "{"+ className + "(v" + revision.substring(11, revision.length() - 2) + ")}"; |
42 |
> |
return friendlyName + "{"+ tidyClassName(className) + "(v" + revision.substring(11, revision.length() - 2) + ")}"; |
43 |
|
} |
44 |
+ |
} |
45 |
+ |
|
46 |
+ |
/** |
47 |
+ |
* If the class name begins with uk.ac.ukc.iscream |
48 |
+ |
* this method will trim it off, otherwise it |
49 |
+ |
* leaves the string unchanged. |
50 |
+ |
* |
51 |
+ |
* @param className the name of a class |
52 |
+ |
* |
53 |
+ |
* @return the tidy version of it |
54 |
+ |
*/ |
55 |
+ |
private static String tidyClassName(String className) { |
56 |
+ |
if (className.startsWith("uk.ac.ukc.iscream")) { |
57 |
+ |
return className.substring(18); |
58 |
+ |
} |
59 |
+ |
return className; |
60 |
|
} |
61 |
|
|
62 |
|
//---CONSTRUCTORS--- |