--- projects/cms/source/util/uk/org/iscream/cms/util/FormatName.java 2000/12/08 11:40:08 1.2 +++ projects/cms/source/util/uk/org/iscream/cms/util/FormatName.java 2000/12/12 18:24:00 1.3 @@ -10,7 +10,7 @@ package uk.ac.ukc.iscream.util; * a toString String to send to the logger. * * @author $Author: ajm $ - * @version $Id: FormatName.java,v 1.2 2000/12/08 11:40:08 ajm Exp $ + * @version $Id: FormatName.java,v 1.3 2000/12/12 18:24:00 ajm Exp $ */ public class FormatName { @@ -24,6 +24,9 @@ public class FormatName { * This is of use to the override of the toString() as * implemented by most of the iscream objects. * + * It has support for null friendly name and null class name + * bit NOT both at the same time. + * * @param friendlyName the configured name of the instance of the calling component the class is in (eg "filter1") * @param className the class name of the calling class, as obtained by getClass().getName() * @param revision the CVS Revision number for the calling class @@ -32,9 +35,12 @@ public class FormatName { */ public static String getName(String friendlyName, String className, String revision) { if (friendlyName == null) { - return "{"+ className + "}(" + revision.substring(11, revision.length() - 2) + ")"; + return "{"+ className + "(v" + revision.substring(11, revision.length() - 2) + ")}"; + } else if (className == null) { + return friendlyName + "{static(v" + revision.substring(11, revision.length() - 2) + ")}"; + } else { + return friendlyName + "{"+ className + "(v" + revision.substring(11, revision.length() - 2) + ")}"; } - return friendlyName + "{"+ className + "}(" + revision.substring(11, revision.length() - 2) + ")"; } //---CONSTRUCTORS---