Skip to content
Version.java 2.68 KiB
Newer Older
package dk.gov.oiosi;

/**
 * Administrative class to keep track of the version number of the OIORASP
 * release.
 * <p>
 * This class is created to be similar to Version classes in Apache project,
 * e.g. org.apache.xalan.Version.
 * <p>
 * In future it can be used by configuration procedures to check proper library
 * related environment update.
 * <p>
 * Do not mix it with dk.gov.oiosi.common.Version, which is Version of server
 * and contains another information.
 * 
 * @since OIORASP 1.2.4
 */
public class Version {

	/**
	 * Get the basic version string for the current OIORASP release. Version
	 * String formatted like
	 * <p>
	 * <CODE>"<B>OIORASP</B> <B>Java</B> v.r.d"</CODE>.
	 * <p>
	 * where v - major version number, r - release number, d - maintanance
	 * version number
	 * 
	 * @return String denoting our current version
	 */
	public static String getVersion() {
		StringBuilder sb = new StringBuilder();
		sb.append(getProduct());
		sb.append(" ");
		sb.append(getImplementationLanguage());
		sb.append(" ");
		sb.append(getMajorVersionNum());
		sb.append(".");
		sb.append(getReleaseVersionNum());
		sb.append(".");
		sb.append(getMaintenanceVersionNum());
		return sb.toString();
	}

	/**
	 * Print the processor version to the command line.
	 * 
	 * @param argv
	 *            command line arguments, unused.
	 */
	public static void main(String argv[]) {
		System.out.println(getVersion());
	}

	/**
	 * Name of product: OIORASP.
	 */
	public static String getProduct() {
		return "OIORASP";
	}

	/**
	 * Implementation Language: Java.
	 */
	public static String getImplementationLanguage() {
		return "Java";
	}

	/**
	 * Major version number. Version number. This changes only when there is a
	 * significant, externally apparent enhancement from the previous release.
	 * 'n' represents the n'th version.
	 * 
	 * Clients should carefully consider the implications of new versions as
	 * external interfaces and behaviour may have changed.
	 */
	public static int getMajorVersionNum() {
		return 1;

	}

	/**
	 * Release Number. Release number. This changes when: - a new set of
	 * functionality is to be added, eg, implementation of a new W3C
	 * specification. - API or behaviour change. - its designated as a reference
	 * release.
	 */
	public static int getReleaseVersionNum() {
		return 3;
	}

	/**
	 * Maintenance Drop Number. This identifier is used to designate maintenance
	 * drop applied to a specific release and contains fixes for defects
	 * reported. It maintains compatibility with the release and contains no API
	 * changes.
	 */
	public static int getMaintenanceVersionNum() {
		return 0;
	}
}