|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.cleancode.data.Version
public final class Version
Manages version numbers for all loaded classes.
By convention, each class should call getVersion
(typically by assigning it to a class variable VERSION
), as
in:
public static final String VERSION =
Version.getVersion(className , "$Revision: 9 $");
The string "$Revision: 9 $"
is for RCS; substitute the
appropriate designator for the source control system of your choice.
Besides returning the version number, this method will display
the version number appropriately if the system has bootstrapped
sufficiently. Otherwise, it is stored until system initialization
has progressed, and then all collected version numbers are displayed.
In either case, the display is done by a Diagnostic
module which
sends messages to the output channels selected via a configuration file.
Field Summary | |
---|---|
static String |
VERSION
Current version of this class. |
Method Summary | |
---|---|
static String |
getVersion(Object anObject)
Returns the version number of the class of the passed object. |
static String |
getVersion(Object anObject,
String verString)
Determine a version number, record it for diagnostics, and return it. |
static String |
getVersion(String className)
Returns the version number of the named class. |
static String |
getVersion(String className,
String verString)
Determine a version number, record it for diagnostics, and return it. |
static void |
syncVersionDiag()
Once the Diagnostic class has initialized,
it calls this method to change from passive to active mode,
whereby versions are printed immediately rather than being collected. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String VERSION
Method Detail |
---|
public static String getVersion(String className, String verString)
Diagnostic
class has not yet initialized.
className
- name of class to which the verString appliesverString
- RCS version string
public static String getVersion(Object anObject, String verString)
anObject
- object to which the verString appliesverString
- RCS version string
getVersion(String,String)
public static String getVersion(Object anObject)
VERSION
whose value is returned.
anObject
- Object to determine version of
public static String getVersion(String className)
className
- name of class to determine version of
getVersion(Object)
public static void syncVersionDiag()
Diagnostic
class has initialized,
it calls this method to change from passive to active mode,
whereby versions are printed immediately rather than being collected.
Also, the previously collected versions are all output,
in the order modules were loaded.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
CleanCode Java Libraries | Copyright © 2001-2012 Michael Sorens - Revised 2012.12.10 |