Package org.kiwiproject.jackson
Enum Class JacksonDataFormat
- All Implemented Interfaces:
Serializable,Comparable<JacksonDataFormat>,Constable
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.
-
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 JacksonDataFormatReturns one of the enum constants for the givenformatName, orUNKNOWNif the format name is not found.static JacksonDataFormatReturns the enum constant of this class with the specified name.static JacksonDataFormat[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
JSON
-
XML
-
YAML
-
UNKNOWN
-
-
Method Details
-
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
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 nameNullPointerException- if the argument is null
-
from
Returns one of the enum constants for the givenformatName, orUNKNOWNif the format name is not found.The
formatNamemust 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
JsonFactoryand its subclasses.
-
getFormatName
-