public static enum WritableTypeId.Inclusion extends Enum<WritableTypeId.Inclusion>
NOTE: in most cases this only matters with formats that do NOT have native type id capabilities, and require type id to be included within regular data (whether exposed as Java properties or not). Formats with native types usually use native type id functionality regardless, unless overridden by a feature to use "non-native" type inclusion.
Enum Constant and Description |
---|
METADATA_PROPERTY
Inclusion as a property within Object to write, but logically as separate
metadata that is not exposed as payload to caller: that is, does not match
any of visible properties value object has.
|
PARENT_PROPERTY
Inclusion as a property within "parent" Object of value Object to write.
|
PAYLOAD_PROPERTY
Inclusion as a "regular" property within Object to write; this implies that
its value should come from regular POJO property on serialization, and
be deserialized into such property.
|
WRAPPER_ARRAY
Inclusion as wrapper Array (1st element type id, 2nd element value).
|
WRAPPER_OBJECT
Inclusion as wrapper Object that has one key/value pair where type id
is the key for typed value.
|
Modifier and Type | Method and Description |
---|---|
boolean |
requiresObjectContext() |
static WritableTypeId.Inclusion |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static WritableTypeId.Inclusion[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final WritableTypeId.Inclusion WRAPPER_ARRAY
Corresponds to JsonTypeInfo.As.WRAPPER_ARRAY
.
public static final WritableTypeId.Inclusion WRAPPER_OBJECT
Corresponds to JsonTypeInfo.As.WRAPPER_OBJECT
.
public static final WritableTypeId.Inclusion METADATA_PROPERTY
NOTE: if shape of typed value to write is NOT Object, will instead use
WRAPPER_ARRAY
inclusion.
Corresponds to JsonTypeInfo.As.PROPERTY
.
public static final WritableTypeId.Inclusion PAYLOAD_PROPERTY
Regarding handling, type id is ONLY written as native type id; if no native
type ids available, caller is assumed to handle output some other way.
This is different from METADATA_PROPERTY
.
NOTE: if shape of typed value to write is NOT Object, will instead use
WRAPPER_ARRAY
inclusion.
Corresponds to JsonTypeInfo.As.EXISTING_PROPERTY
.
public static final WritableTypeId.Inclusion PARENT_PROPERTY
xxx_PROPERTY
choices.
This also means that root values MAY NOT use this type id inclusion mechanism
(as they have no parent context).
Corresponds to JsonTypeInfo.As.EXTERNAL_PROPERTY
.
public static WritableTypeId.Inclusion[] values()
for (WritableTypeId.Inclusion c : WritableTypeId.Inclusion.values()) System.out.println(c);
public static WritableTypeId.Inclusion 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 boolean requiresObjectContext()
Copyright © 2018 JBoss by Red Hat. All rights reserved.