java.util.Collection
and array types.
| Modifier and Type | Field and Description |
|---|---|
| protected final ValueSerializer | _elementSerializer
Value serializer to use, if it can be statically determined |
| protected final JavaType | |
| 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 elementType, boolean staticTyping, TypeSerializer vts, ValueSerializer<?> 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 elementType, boolean staticTyping, TypeSerializer vts, ValueSerializer<?> elementSerializer, Boolean unwrapSingle)
General purpose constructor. |
| protected | AsArraySerializerBase(Class<?> cls, JavaType elementType, boolean staticTyping, TypeSerializer vts, ValueSerializer<?> elementSerializer, Boolean unwrapSingle, BeanProperty property)
General purpose constructor. |
| protected | AsArraySerializerBase(AsArraySerializerBase<?> src, TypeSerializer vts, ValueSerializer<?> elementSerializer, Boolean unwrapSingle, BeanProperty property)
|
| Modifier and Type | Method and Description |
|---|---|
| public void | acceptJsonFormatVisitor(JsonFormatVisitorWrapper visitor, JavaType typeHint)
Overrides tools. Implements tools. Default implementation specifies no format. |
| public ValueSerializer | createContextual(SerializationContext ctxt, BeanProperty property)
Overrides tools. This method is needed to resolve contextual annotations like
per-property overrides, as well as do recursive call
to |
| public ValueSerializer | getContentSerializer()
Implements abstract tools. 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. |
| public JavaType | getContentType()
Implements abstract tools. Accessor for finding declared (static) element type for type this serializer is used for. |
| protected abstract void | |
| public void | serializeWithType(T value, JsonGenerator g, SerializationContext ctxt, TypeSerializer typeSer)
Overrides tools. 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. |
| protected abstract AsArraySerializerBase | withResolved(BeanProperty property, TypeSerializer vts, ValueSerializer<?> elementSerializer, Boolean unwrapSingle)
|
| _elementSerializer | back to summary |
|---|---|
| protected final ValueSerializer<Object> _elementSerializer Value serializer to use, if it can be statically determined | |
| _elementType | back to summary |
|---|---|
| protected final JavaType _elementType | |
| _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 elementType, boolean staticTyping, TypeSerializer vts, ValueSerializer<?> 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 elementType, boolean staticTyping, TypeSerializer vts, ValueSerializer<?> elementSerializer, Boolean unwrapSingle) General purpose constructor. Use contextual constructors, if possible.
| |
| AsArraySerializerBase | back to summary |
|---|---|
| protected AsArraySerializerBase(Class<?> cls, JavaType elementType, boolean staticTyping, TypeSerializer vts, ValueSerializer<?> elementSerializer, Boolean unwrapSingle, BeanProperty property) General purpose constructor. Use contextual constructors, if possible.
| |
| AsArraySerializerBase | back to summary |
|---|---|
protected AsArraySerializerBase(AsArraySerializerBase<?> src, TypeSerializer vts, ValueSerializer<?> elementSerializer, Boolean unwrapSingle, BeanProperty property)
| |
| acceptJsonFormatVisitor | back to summary |
|---|---|
| public void acceptJsonFormatVisitor(JsonFormatVisitorWrapper visitor, JavaType typeHint) throws JacksonException Overrides tools. Implements tools. Doc from tools. Default implementation specifies no format. This behavior is usually overriden by custom serializers.
| |
| createContextual | back to summary |
|---|---|
| public ValueSerializer Overrides tools. This method is needed to resolve contextual annotations like
per-property overrides, as well as do recursive call
to
| |
| getContentSerializer | back to summary |
|---|---|
| public ValueSerializer Implements abstract tools. Doc from tools. 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 tools. Doc from tools. Accessor for finding declared (static) element type for type this serializer is used for.
| |
| serializeContents | back to summary |
|---|---|
| protected abstract void serializeContents(T value, JsonGenerator gen, SerializationContext provider) throws JacksonException | |
| serializeWithType | back to summary |
|---|---|
| public void serializeWithType(T value, JsonGenerator g, SerializationContext ctxt, TypeSerializer typeSer) throws JacksonException Overrides tools. Doc from tools. 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 |
|---|---|
| protected abstract AsArraySerializerBase | |