Enum Class JacksonDataFormat

java.lang.Object
java.lang.Enum<JacksonDataFormat>
org.kiwiproject.jackson.JacksonDataFormat
All Implemented Interfaces:
Serializable, Comparable<JacksonDataFormat>, Constable

public enum JacksonDataFormat extends Enum<JacksonDataFormat>
Represents the detected type of the given String.

Currently only supports JSON, XML, and YAML formats.

See Also:
  • DataFormatDetector
Implementation Note:
Uses Jackson under the covers. You will need to ensure that jackson-core, jackson-dataformat-xml and jackson-dataformat-yaml dependencies are present at runtime.
  • Enum Constant Details

  • Method Details

    • values

      public static JacksonDataFormat[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static JacksonDataFormat valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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 class has no constant with the specified name
      NullPointerException - if the argument is null
    • from

      public static JacksonDataFormat from(String formatName)
      Returns one of the enum constants for the given formatName, or UNKNOWN if the format name is not found.

      The formatName must match exactly (i.e. is case-sensitive).

      Parameters:
      formatName - the format name as a String
      Returns:
      the JacksonDataFormat corresponding to the given format name (exact match)
      API Note:
      See the getFormatName() method which returns the name of the returned format
      Implementation Note:
      Format names are the values of the public constants in the appropriate Jackson JsonFactory and its subclasses.
    • getFormatName

      public String getFormatName()