Package com.helger.xml
Enum EXMLVersion
- All Implemented Interfaces:
Serializable,Comparable<EXMLVersion>,java.lang.constant.Constable
XML version determinator.
- Author:
- boris
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionstatic EXMLVersiongetFromVersionOrDefault(String sVersion, EXMLVersion eDefault) Find theEXMLVersionobject matching the passed version string.static EXMLVersiongetFromVersionOrNull(String sVersion) Find theEXMLVersionobject matching the passed version string.static EXMLVersionReturns 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 Details
-
XML_10
XML 1.0 - this should be the default -
XML_11
XML 1.1
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
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
- Returns:
- The textual representation of the XML version number.
-
getFromVersionOrNull
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.
-