public static enum JsonFactory.Feature extends Enum<JsonFactory.Feature> implements JacksonFeature
JsonFactory
.Enum Constant and Description |
---|
CANONICALIZE_FIELD_NAMES
Feature that determines whether JSON object field names are
to be canonicalized (details of how canonicalization is done
then further specified by
INTERN_FIELD_NAMES ). |
CHARSET_DETECTION
Feature to control charset detection for byte-based inputs (
byte[] , InputStream ...). |
FAIL_ON_SYMBOL_HASH_OVERFLOW
Feature that determines what happens if we encounter a case in symbol
handling where number of hash collisions exceeds a safety threshold
-- which almost certainly means a denial-of-service attack via generated
duplicate hash codes.
|
INTERN_FIELD_NAMES
Feature that determines whether JSON object field names are
to be canonicalized using
String.intern() or not:
if enabled, all field names will be intern()ed (and caller
can count on this being true for all such names); if disabled,
no intern()ing is done. |
USE_THREAD_LOCAL_FOR_BUFFER_RECYCLING
Feature that determines whether we will use
BufferRecycler with
ThreadLocal and SoftReference , for efficient reuse of
underlying input/output buffers. |
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 . |
static JsonFactory.Feature |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static JsonFactory.Feature[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final JsonFactory.Feature INTERN_FIELD_NAMES
String.intern()
or not:
if enabled, all field names will be intern()ed (and caller
can count on this being true for all such names); if disabled,
no intern()ing is done. There may still be basic
canonicalization (that is, same String will be used to represent
all identical object property names for a single document).
Note: this setting only has effect if
CANONICALIZE_FIELD_NAMES
is true -- otherwise no
canonicalization of any sort is done.
This setting is enabled by default.
public static final JsonFactory.Feature CANONICALIZE_FIELD_NAMES
INTERN_FIELD_NAMES
).
This setting is enabled by default.
public static final JsonFactory.Feature FAIL_ON_SYMBOL_HASH_OVERFLOW
IllegalStateException
is
thrown to indicate the suspected denial-of-service attack; if disabled, processing continues but
canonicalization (and thereby intern()
ing) is disabled) as protective
measure.
This setting is enabled by default.
public static final JsonFactory.Feature USE_THREAD_LOCAL_FOR_BUFFER_RECYCLING
BufferRecycler
with
ThreadLocal
and SoftReference
, for efficient reuse of
underlying input/output buffers.
This usually makes sense on normal J2SE/J2EE server-side processing;
but may not make sense on platforms where SoftReference
handling
is broken (like Android), or if there are retention issues due to
ThreadLocal
(see
jackson-core#189
for a possible case)
This setting is enabled by default.
public static final JsonFactory.Feature CHARSET_DETECTION
byte[]
, InputStream
...).
When this feature is enabled (the default), the factory will allow UTF-16 and UTF-32 inputs and try to detect
them, as specified by RFC 4627. When this feature is disabled the factory will assume UTF-8,
as specified by RFC 8259.
This setting is enabled by default.
public static JsonFactory.Feature[] values()
for (JsonFactory.Feature c : JsonFactory.Feature.values()) System.out.println(c);
public static JsonFactory.Feature valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic static int collectDefaults()
public boolean enabledByDefault()
JacksonFeature
enabledByDefault
in interface JacksonFeature
public boolean enabledIn(int flags)
JacksonFeature
enabledIn
in interface JacksonFeature
flags
- Bit field that contains a set of enabled features of this typepublic int getMask()
JacksonFeature
1 << N
.getMask
in interface JacksonFeature
Copyright © 2008–2024 FasterXML. All rights reserved.