Package com.fasterxml.jackson.core
Enum JsonEncoding
- java.lang.Object
-
- java.lang.Enum<JsonEncoding>
-
- com.fasterxml.jackson.core.JsonEncoding
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<JsonEncoding>
public enum JsonEncoding extends java.lang.Enum<JsonEncoding>
Enumeration that defines legal encodings that can be used for JSON content, based on list of allowed encodings from JSON specification.Note: if application want to explicitly disregard Encoding limitations (to read in JSON encoded using an encoding not listed as allowed), they can use
Reader
/Writer
instances as input
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
bits()
java.lang.String
getJavaName()
Method for accessing encoding name that JDK will support.boolean
isBigEndian()
Whether encoding is big-endian (if encoding supports such notion).static JsonEncoding
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static JsonEncoding[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
UTF8
public static final JsonEncoding UTF8
-
UTF16_BE
public static final JsonEncoding UTF16_BE
-
UTF16_LE
public static final JsonEncoding UTF16_LE
-
UTF32_BE
public static final JsonEncoding UTF32_BE
-
UTF32_LE
public static final JsonEncoding UTF32_LE
-
-
Method Detail
-
values
public static JsonEncoding[] 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 (JsonEncoding c : JsonEncoding.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static JsonEncoding valueOf(java.lang.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:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null
-
getJavaName
public java.lang.String getJavaName()
Method for accessing encoding name that JDK will support.- Returns:
- Matching encoding name that JDK will support.
-
isBigEndian
public boolean isBigEndian()
Whether encoding is big-endian (if encoding supports such notion). If no such distinction is made (as is the case forUTF8
), return value is undefined.- Returns:
- True for big-endian encodings; false for little-endian (or if not applicable)
-
bits
public int bits()
-
-