com.sun.tools.xjc.api

Class SpecVersion

public class SpecVersion extends Enum<SpecVersion>

Represents the spec version constant.
Field Summary
static SpecVersionLATEST
static SpecVersionV2_0
static SpecVersionV2_1
static SpecVersionV2_2
static List<SpecVersion>VALUES
An immutable list containing the values comprising this enum class in the order they're declared.
Method Summary
List<SpecVersion>family()
Returns an immutable list containing the values comprising this enum class in the order they're declared.
booleanisLaterThan(SpecVersion t)
Returns true if this version is equal or later than the given one.
static SpecVersionparse(String token)
Parses "2.0", "2.1", and "2.2" into the SpecVersion object.
static SpecVersionvalueOf(String name)
Static factory to return the enum constant pertaining to the given string name.

Field Detail

LATEST

public static final SpecVersion LATEST

V2_0

public static final SpecVersion V2_0

V2_1

public static final SpecVersion V2_1

V2_2

public static final SpecVersion V2_2

VALUES

public static final List<SpecVersion> VALUES
An immutable list containing the values comprising this enum class in the order they're declared. This field may be used to iterate over the constants as follows:
for(SpecVersion c : SpecVersion.VALUES)
    System.out.println(c);

Method Detail

family

public final List<SpecVersion> family()
Returns an immutable list containing the values comprising this enum class in the order they're declared. This instance method simply returns VALUES. Few programmers should have any need to use this method. It is provided for use by sophisticated enum-based data structures to prevent the need for reflective access to VALUES.

Returns: an immutable list containing the values comprising this enum class, in the order they're declared.

isLaterThan

public boolean isLaterThan(SpecVersion t)
Returns true if this version is equal or later than the given one.

parse

public static SpecVersion parse(String token)
Parses "2.0", "2.1", and "2.2" into the SpecVersion object.

Returns: null for parsing failure.

valueOf

public static final SpecVersion valueOf(String name)
Static factory to return the enum constant pertaining to the given string name. The string must match exactly an identifier used to declare an enum constant in this type.

Throws: IllegalArgumentException if this enum class has no constant with the specified name.