Package com.helger.xml
Enum EXMLVersion
- java.lang.Object
-
- java.lang.Enum<EXMLVersion>
-
- com.helger.xml.EXMLVersion
-
- All Implemented Interfaces:
Serializable,Comparable<EXMLVersion>
public enum EXMLVersion extends Enum<EXMLVersion>
XML version determinator.- Author:
- boris
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static EXMLVersiongetFromVersionOrDefault(String sVersion, EXMLVersion eDefault)Find theEXMLVersionobject matching the passed version string.static EXMLVersiongetFromVersionOrNull(String sVersion)Find theEXMLVersionobject matching the passed version string.StringgetVersion()static EXMLVersionvalueOf(String name)Returns the enum constant of this type with the specified name.static EXMLVersion[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
XML_10
public static final EXMLVersion XML_10
XML 1.0 - this should be the default
-
XML_11
public static final EXMLVersion XML_11
XML 1.1
-
-
Method Detail
-
values
public static EXMLVersion[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (EXMLVersion c : EXMLVersion.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static EXMLVersion valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum type has no constant with the specified nameNullPointerException- if the argument is null
-
getVersion
@Nonnull @Nonempty public String getVersion()
- Returns:
- The textual representation of the XML version number.
-
getFromVersionOrNull
@Nullable public static EXMLVersion getFromVersionOrNull(@Nullable String sVersion)
Find theEXMLVersionobject matching the passed version string.- Parameters:
sVersion- The version string to search. May benull.- Returns:
nullif no suchEXMLVersionobject is present.
-
getFromVersionOrDefault
@Nullable public static EXMLVersion getFromVersionOrDefault(@Nullable String sVersion, @Nullable EXMLVersion eDefault)
Find theEXMLVersionobject matching the passed version string.- Parameters:
sVersion- The version string to search. May benull.eDefault- The default version to be returned, if no such enum value is present. May benull.- Returns:
- The provided default version (which may be
null) if no suchEXMLVersionobject is present.
-
-