FileDocCategorySizeDatePackage
Version.javaAPI DocGlassfish v2 API4356Tue May 22 16:54:14 BST 2007oracle.toplink.essentials

Version

public class Version extends Object
This class stores variables for the version and build Numbers that are used in printouts and exceptions.
author
Eric Gwin
since
1.0, 1.16 Added get and set Methods. Made variables private. - EJG

Fields Summary
private static final String
CopyrightString
private static String
product
private static final String
version
private static final String
buildNumber
public static final int
JDK_VERSION_NOT_SET
Keep track of JDK version in order to make some decisions about datastructures.
public static final int
JDK_1_3
public static final int
JDK_1_4
public static final int
JDK_1_5
public static int
JDK_VERSION
Constructors Summary
Methods Summary
public static java.lang.StringgetBuildNumber()

        return buildNumber;
    
public static intgetJDKVersion()
INTERNAL: return the JDK version we are using.

        if (JDK_VERSION == JDK_VERSION_NOT_SET) {
            String version = System.getProperty("java.version");
            if ((version != null) && version.startsWith("1.5")) {
                useJDK15();
            } else if ((version != null) && version.startsWith("1.4")) {
                useJDK14();
            } else {
                useJDK13();
            }
        }
        return JDK_VERSION;
    
public static java.lang.StringgetProduct()


        
        return product;
    
public static java.lang.StringgetVersion()

        return version;
    
public static booleanisJDK13()

        return getJDKVersion() == JDK_1_3;
    
public static booleanisJDK14()

        return getJDKVersion() == JDK_1_4;
    
public static booleanisJDK15()

        return getJDKVersion() == JDK_1_5;
    
public static voidsetProduct(java.lang.String ProductName)

        product = ProductName;
    
public static voiduseJDK13()

        JDK_VERSION = JDK_1_3;
    
public static voiduseJDK14()

        JDK_VERSION = JDK_1_4;
    
public static voiduseJDK15()

        JDK_VERSION = JDK_1_5;