ome.system
Class Version

java.lang.Object
  extended by ome.system.Version

public abstract class Version
extends Object

static utililty for checking Omero classes for revision number and date.

Since:
3.0-M3
Version:
$Revision: 3352 $, $Date: 2006-12-15 09:44:52 +0100 (Fri, 15 Dec 2006) $
Author:
Josh Moore, josh.moore at gmx.de
See Also:
RevisionDate, RevisionNumber, SimpleDateFormat

Field Summary
static String SVN_DATE_FORMAT
          Date format used by Subversions "Date" keyword.
 
Constructor Summary
Version()
           
 
Method Summary
static Date getDate(Class klass)
          Parses the given class for its RevisionDate annotation.
static Integer getRevision(Class klass)
          Parses the given class for its RevisionNumber annotation.
static String stringFromSvnString(String keyword)
          Parses the given String to remove the leading "$", keyword name, and colons.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SVN_DATE_FORMAT

public static final String SVN_DATE_FORMAT
Date format used by Subversions "Date" keyword. This can be used as the constructor argument to a SimpleDateFormat in order to parse RevisionDate values.

See Also:
Constant Field Values
Constructor Detail

Version

public Version()
Method Detail

getRevision

public static Integer getRevision(Class klass)
Parses the given class for its RevisionNumber annotation. A null class argument is tolerated and returns a null Integer. Otherwise, the String contained in RevisionNumber.value() will be parsed as an Integer after processing by stringFromSvnString(String) if possible. Otherwise a null is returned.

Returns:
Integer value of RevisionNumber.value()

getDate

public static Date getDate(Class klass)
Parses the given class for its RevisionDate annotation. A null class argument is tolerated and returns a null Date. Otherwise, the String contained in RevisionDate.value() will be parsed as an Date after processing by stringFromSvnString(String) and a SimpleDateFormat configured with SVN_DATE_FORMAT if possible. Otherwise a null is returned.

Returns:
Date value of RevisionDate.value()

stringFromSvnString

public static String stringFromSvnString(String keyword)
Parses the given String to remove the leading "$", keyword name, and colons. This assumes that Subversion keywords are formatted such that the first space and the last space in the String, directly surround the value of interest. If this does not hold or if the argument is null, a null is returned.



OmeroJava Api

Version: Beta-4.2.0-r7571-b29

Copyright © 2009 The University of Dundee. All Rights Reserved.