Skip to content
Version.java 2.91 KiB
Newer Older
 * Administrative class to keep track of the version number of the OIORASP release.
 * This class is created to be similar to Version classes in Apache project, e.g. org.apache.xalan.Version.
 * In future it can be used by configuration procedures to check proper library related environment update.
 * Do not mix it with dk.gov.oiosi.common.Version, which is Version of server and contains another information.
 *
 * @since OIORASP 1.3.0
     * 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 - maintenance 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());
    }
    /**
     * @return Name of product: OIORASP.
     */
    public static String getProduct() {
        return "OIORASP";
    }
    /**
     * @return Implementation Language: Java.
     */
    public static String getImplementationLanguage() {
        return "Java";
    }
     * @return Major 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;
     * @return 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;
    }
     * @return 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;
    }