public enum JsonWriteFeature extends java.lang.Enum<JsonWriteFeature> implements FormatFeature
Enum Constant and Description |
---|
ESCAPE_NON_ASCII
Feature that specifies that all characters beyond 7-bit ASCII
range (i.e.
|
QUOTE_FIELD_NAMES
Feature that determines whether JSON Object field names are
quoted using double-quotes, as specified by JSON specification
or not.
|
WRITE_NAN_AS_STRINGS
Feature that determines whether "NaN" ("not a number", that is, not
real number) float/double values are output as JSON strings.
|
WRITE_NUMBERS_AS_STRINGS
Feature that forces all regular number values to be written as JSON Strings,
instead of as JSON Numbers.
|
Modifier and Type | Method and Description |
---|---|
static int |
collectDefaults()
Method that calculates bit set (flags) of all features that
are enabled by default.
|
boolean |
enabledByDefault()
Accessor for checking whether this feature is enabled by default.
|
boolean |
enabledIn(int flags)
Convenience method for checking whether feature is enabled in given bitmask
|
int |
getMask()
Returns bit mask for this feature instance; must be a single bit,
that is of form
(1 << N) |
JsonGenerator.Feature |
mappedFeature() |
static JsonWriteFeature |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static JsonWriteFeature[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final JsonWriteFeature QUOTE_FIELD_NAMES
Feature is enabled by default (since it is required by JSON specification).
public static final JsonWriteFeature WRITE_NAN_AS_STRINGS
Feature is enabled by default.
public static final JsonWriteFeature WRITE_NUMBERS_AS_STRINGS
One use case is to avoid problems with Javascript limitations: since Javascript standard specifies that all number handling should be done using 64-bit IEEE 754 floating point values, result being that some 64-bit integer values can not be accurately represent (as mantissa is only 51 bit wide).
Feature is disabled by default.
public static final JsonWriteFeature ESCAPE_NON_ASCII
Feature is disabled by default.
public static JsonWriteFeature[] values()
for (JsonWriteFeature c : JsonWriteFeature.values()) System.out.println(c);
public static JsonWriteFeature valueOf(java.lang.String name)
name
- the name of the enum constant to be returned.java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is nullpublic static int collectDefaults()
public boolean enabledByDefault()
FormatFeature
enabledByDefault
in interface FormatFeature
public int getMask()
FormatFeature
(1 << N)
getMask
in interface FormatFeature
public boolean enabledIn(int flags)
FormatFeature
enabledIn
in interface FormatFeature
public JsonGenerator.Feature mappedFeature()
Copyright © 2010 - 2020 Adobe. All Rights Reserved