Deprecated
as a consequence of ContainerSerializer being deprecated. See corresponding docs for further information.
java.util.Collection
and array types.
| Modifier and Type | Field and Description |
|---|---|
| protected PropertySerializerMap | _dynamicSerializers
If element type cannot be statically determined, mapping from runtime type to serializer is handled using this object |
| protected final JsonSerializer | _elementSerializer
Value serializer to use, if it can be statically determined |
| protected final JavaType | |
| protected final BeanProperty | _property
Collection-valued property being serialized with this instance |
| protected final boolean | |
| protected final Boolean | _unwrapSingle
Setting for specific local override for "unwrap single element arrays": true for enable unwrapping, false for preventing it, `null` for using global configuration. |
| protected final TypeSerializer | _valueTypeSerializer
Type serializer used for values, if any. |
| Access | Constructor and Description |
|---|---|
| protected | AsArraySerializerBase(Class<?> cls, JavaType et, boolean staticTyping, TypeSerializer vts, JsonSerializer<Object> elementSerializer)
Non-contextual, "blueprint" constructor typically called when the first instance is created, without knowledge of property it was used via. |
| protected | AsArraySerializerBase(Class<?> cls, JavaType et, boolean staticTyping, TypeSerializer vts, BeanProperty property, JsonSerializer<Object> elementSerializer)
Deprecated
Since 2.6 Use variants that either take 'src', or do NOT pass
BeanProperty
|
| protected | AsArraySerializerBase(Class<?> cls, JavaType elementType, boolean staticTyping, TypeSerializer vts, BeanProperty property, JsonSerializer<?> elementSerializer, Boolean unwrapSingle)
General purpose constructor. |
| protected | AsArraySerializerBase(AsArraySerializerBase<?> src, BeanProperty property, TypeSerializer vts, JsonSerializer<?> elementSerializer, Boolean unwrapSingle)
Deprecated
as a consequence of
AsArraySerializerBase being deprecated.
|
| protected | AsArraySerializerBase(AsArraySerializerBase<?> src, BeanProperty property, TypeSerializer vts, JsonSerializer<?> elementSerializer)
Deprecated
since 2.6: use the overloaded method that takes 'unwrapSingle'
|
| Modifier and Type | Method and Description |
|---|---|
| protected final JsonSerializer | |
| protected final JsonSerializer | |
| public void | acceptJsonFormatVisitor(JsonFormatVisitorWrapper visitor, JavaType
Type of element (entity like property) being visited typeHint)Overrides com. Implements com. |
| public JsonSerializer | createContextual(SerializerProvider
Serializer provider to use for accessing config, other serializers serializers, BeanProperty Method or field that represents the property
(and is used to access value to serialize).
Should be available; but there may be cases where caller cannot provide it and
null is passed instead (in which case impls usually pass 'this' serializer as is) property)Implements com. createContextual of content serializer, if
known statically.
|
| public JsonSerializer | getContentSerializer()
Implements abstract com. |
| public JavaType | getContentType()
Implements abstract com. |
| public JsonNode | getSchema(SerializerProvider
The serializer provider. provider, Type A hint about the type. typeHint)Overrides com. Implements com.
Deprecated
Since 2.15
Default implementation simply claims type is "string"; usually
overriden by custom serializers.
|
| public void | serialize(T
Value to serialize; can not be null. value, JsonGenerator Generator used to output resulting Json content gen, SerializerProvider Provider that can be used to get serializers for
serializing Objects value contains, if any. provider)Implements abstract com. |
| protected abstract void | |
| public void | serializeWithType(T
Value to serialize; can not be null. value, JsonGenerator Generator used to output resulting Json content g, SerializerProvider Provider that can be used to get serializers for
serializing Objects value contains, if any. provider, TypeSerializer Type serializer to use for including type information typeSer)Overrides com. |
| public final AsArraySerializerBase | withResolved(BeanProperty property, TypeSerializer vts, JsonSerializer<?> elementSerializer)
Deprecated
since 2.6: use the overloaded method that takes 'unwrapSingle'
|
| public abstract AsArraySerializerBase | withResolved(BeanProperty property, TypeSerializer vts, JsonSerializer<?> elementSerializer, Boolean unwrapSingle)
Deprecated
as a consequence of
AsArraySerializerBase being deprecated.
|
| _dynamicSerializers | back to summary |
|---|---|
| protected PropertySerializerMap _dynamicSerializers If element type cannot be statically determined, mapping from runtime type to serializer is handled using this object | |
| _elementSerializer | back to summary |
|---|---|
| protected final JsonSerializer<Object> _elementSerializer Value serializer to use, if it can be statically determined | |
| _elementType | back to summary |
|---|---|
| protected final JavaType _elementType | |
| _property | back to summary |
|---|---|
| protected final BeanProperty _property Collection-valued property being serialized with this instance | |
| _staticTyping | back to summary |
|---|---|
| protected final boolean _staticTyping | |
| _unwrapSingle | back to summary |
|---|---|
| protected final Boolean _unwrapSingle Setting for specific local override for "unwrap single element arrays": true for enable unwrapping, false for preventing it, `null` for using global configuration.
| |
| _valueTypeSerializer | back to summary |
|---|---|
| protected final TypeSerializer _valueTypeSerializer Type serializer used for values, if any. | |
| AsArraySerializerBase | back to summary |
|---|---|
| protected AsArraySerializerBase(Class<?> cls, JavaType et, boolean staticTyping, TypeSerializer vts, JsonSerializer<Object> elementSerializer) Non-contextual, "blueprint" constructor typically called when the first instance is created, without knowledge of property it was used via.
| |
| AsArraySerializerBase | back to summary |
|---|---|
| protected AsArraySerializerBase(Class<?> cls, JavaType et, boolean staticTyping, TypeSerializer vts, BeanProperty property, JsonSerializer<Object> elementSerializer)
Deprecated Since 2.6 Use variants that either take 'src', or do NOT pass BeanProperty
| |
| AsArraySerializerBase | back to summary |
|---|---|
| protected AsArraySerializerBase(Class<?> cls, JavaType elementType, boolean staticTyping, TypeSerializer vts, BeanProperty property, JsonSerializer<?> elementSerializer, Boolean unwrapSingle) General purpose constructor. Use contextual constructors, if possible.
| |
| AsArraySerializerBase | back to summary |
|---|---|
| protected AsArraySerializerBase(AsArraySerializerBase<?> src, BeanProperty property, TypeSerializer vts, JsonSerializer<?> elementSerializer, Boolean unwrapSingle)
Deprecated as a consequence of
| |
| AsArraySerializerBase | back to summary |
|---|---|
| protected AsArraySerializerBase(AsArraySerializerBase<?> src, BeanProperty property, TypeSerializer vts, JsonSerializer<?> elementSerializer)
Deprecated since 2.6: use the overloaded method that takes 'unwrapSingle'
| |
| _findAndAddDynamic | back to summary |
|---|---|
| protected final JsonSerializer | |
| _findAndAddDynamic | back to summary |
|---|---|
| protected final JsonSerializer | |
| acceptJsonFormatVisitor | back to summary |
|---|---|
| public void acceptJsonFormatVisitor(JsonFormatVisitorWrapper visitor, JavaType typeHint) throws JsonMappingException Overrides com. Implements com. Doc from com. Default implementation specifies no format. This behavior is usually overriden by custom serializers.
| |
| createContextual | back to summary |
|---|---|
| public JsonSerializer Implements com. This method is needed to resolve contextual annotations like
per-property overrides, as well as do recursive call
to
| |
| getContentSerializer | back to summary |
|---|---|
| public JsonSerializer Implements abstract com. Doc from com. Accessor for serializer used for serializing contents
(List and array elements, Map values etc) of the
container for which this serializer is used, if it is
known statically.
Note that for dynamic types this may return null; if so,
caller has to instead use
| |
| getContentType | back to summary |
|---|---|
| public JavaType getContentType() Implements abstract com. Doc from com. Accessor for finding declared (static) element type for type this serializer is used for.
| |
| getSchema | back to summary |
|---|---|
| public JsonNode getSchema(SerializerProvider provider, Type typeHint) throws JsonMappingException Overrides com. Implements com. Doc from com. Deprecated Since 2.15 Default implementation simply claims type is "string"; usually overriden by custom serializers.
| |
| serialize | back to summary |
|---|---|
| public void serialize(T value, JsonGenerator gen, SerializerProvider provider) throws IOException Implements abstract com. Doc from com. Method that can be called to ask implementation to serialize values of type this serializer handles.
| |
| serializeContents | back to summary |
|---|---|
| protected abstract void serializeContents(T value, JsonGenerator gen, SerializerProvider provider) throws IOException | |
| serializeWithType | back to summary |
|---|---|
| public void serializeWithType(T value, JsonGenerator g, SerializerProvider provider, TypeSerializer typeSer) throws IOException Overrides com. Doc from com. Method that can be called to ask implementation to serialize values of type this serializer handles, using specified type serializer for embedding necessary type information.
Default implementation will throw For simple datatypes written as a single scalar value (JSON String, Number, Boolean), implementation would look like: // note: method to call depends on whether this type is serialized as JSON scalar, object or Array! typeSer.writeTypePrefixForScalar(value, gen); serialize(value, gen, provider); typeSer.writeTypeSuffixForScalar(value, gen);and implementations for type serialized as JSON Arrays or Objects would differ slightly, as START-ARRAY/END-ARRAY and
START-OBJECT/END-OBJECT pairs
need to be properly handled with respect to serializing of contents.
| |
| withResolved | back to summary |
|---|---|
| public final AsArraySerializerBase Deprecated since 2.6: use the overloaded method that takes 'unwrapSingle'
| |
| withResolved | back to summary |
|---|---|
| public abstract AsArraySerializerBase Deprecated as a consequence of
| |