Enum EXMLVersion

java.lang.Object
java.lang.Enum<EXMLVersion>
com.helger.xml.EXMLVersion
All Implemented Interfaces:
Serializable, Comparable<EXMLVersion>, java.lang.constant.Constable

public enum EXMLVersion extends Enum<EXMLVersion>
XML version determinator.
Author:
boris
  • Enum Constant Details

    • 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 Details

    • values

      public static EXMLVersion[] 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

      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 name
      NullPointerException - 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 the EXMLVersion object matching the passed version string.
      Parameters:
      sVersion - The version string to search. May be null.
      Returns:
      null if no such EXMLVersion object is present.
    • getFromVersionOrDefault

      @Nullable public static EXMLVersion getFromVersionOrDefault(@Nullable String sVersion, @Nullable EXMLVersion eDefault)
      Find the EXMLVersion object matching the passed version string.
      Parameters:
      sVersion - The version string to search. May be null.
      eDefault - The default version to be returned, if no such enum value is present. May be null.
      Returns:
      The provided default version (which may be null) if no such EXMLVersion object is present.