Package com.helger.xml.serialize.write
Enum EXMLSerializeVersion
- java.lang.Object
-
- java.lang.Enum<EXMLSerializeVersion>
-
- com.helger.xml.serialize.write.EXMLSerializeVersion
-
- All Implemented Interfaces:
com.helger.commons.id.IHasID<String>,Serializable,Comparable<EXMLSerializeVersion>
public enum EXMLSerializeVersion extends Enum<EXMLSerializeVersion> implements com.helger.commons.id.IHasID<String>
XML serialization version.- Author:
- Philip Helger
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static EXMLSerializeVersiongetFromIDOrNull(String sID)static EXMLSerializeVersiongetFromXMLVersionOrThrow(EXMLVersion eXMLVersion)Get theEXMLSerializeVersionfrom the specifiedEXMLVersion.StringgetID()EXMLVersiongetXMLVersionOrDefault(EXMLVersion eDefault)StringgetXMLVersionString()booleanisHTML()booleanisXML()static EXMLSerializeVersionvalueOf(String name)Returns the enum constant of this type with the specified name.static EXMLSerializeVersion[]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 EXMLSerializeVersion XML_10
XML 1.0
-
XML_11
public static final EXMLSerializeVersion XML_11
XML 1.1
-
HTML
public static final EXMLSerializeVersion HTML
HTML4 and XHTML
-
-
Method Detail
-
values
public static EXMLSerializeVersion[] 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 (EXMLSerializeVersion c : EXMLSerializeVersion.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static EXMLSerializeVersion 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
-
getID
@Nonnull @Nonempty public String getID()
- Specified by:
getIDin interfacecom.helger.commons.id.IHasID<String>
-
isXML
public boolean isXML()
- Returns:
trueif this is an XML version (1.0 or 1.1)
-
isHTML
public boolean isHTML()
- Returns:
trueif this is HTML (HTML or XHTML)
-
getXMLVersionOrDefault
@Nullable public EXMLVersion getXMLVersionOrDefault(@Nullable EXMLVersion eDefault)
-
getXMLVersionString
@Nullable public String getXMLVersionString()
- Returns:
nullif no XML version is required, the respective version string otherwise.
-
getFromXMLVersionOrThrow
@Nonnull public static EXMLSerializeVersion getFromXMLVersionOrThrow(@Nonnull EXMLVersion eXMLVersion)
Get theEXMLSerializeVersionfrom the specifiedEXMLVersion.- Parameters:
eXMLVersion- XML version to query. May not benull.- Returns:
- Never
null.
-
getFromIDOrNull
@Nullable public static EXMLSerializeVersion getFromIDOrNull(@Nullable String sID)
-
-