java.util.Collection s (Lists, Sets
etc) and java.util.Map s and iterable things
(java.util.Iterator s).Note
in Jackson 2.x, this class was named ContainerSerializer
(in package com.fasterxml.jackson.databind.ser).
| Modifier and Type | Field and Description |
|---|---|
| protected PropertySerializerMap | _dynamicValueSerializers
If value type cannot be statically determined, mapping from runtime value types to serializers are stored in this object. |
| protected final BeanProperty | _property
Property that contains values handled by this serializer, if known; `null`
for root value serializers (ones directly called by |
| Access | Constructor and Description |
|---|---|
| protected | |
| protected | |
| protected | |
| protected | |
| protected |
| Modifier and Type | Method and Description |
|---|---|
| protected ValueSerializer | |
| protected ValueSerializer | |
| protected abstract StdContainerSerializer | _withValueTypeSerializer(TypeSerializer vts)
Method that needs to be implemented to allow construction of a new
serializer object with given |
| public abstract ValueSerializer | getContentSerializer()
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 abstract JavaType | getContentType()
Accessor for finding declared (static) element type for type this serializer is used for. |
| public abstract boolean | hasSingleElement(T value)
Method called to determine if the given value (of type handled by this serializer) contains exactly one element. |
| public abstract boolean | isEmpty(SerializationContext prov, T value)
Overrides tools. Method called to check whether given serializable value is considered "empty" value (for purposes of suppressing serialization of empty values). |
| public StdContainerSerializer | Returns: Serializer instance that uses given type serializer for values if that is possible (or if not, just 'this' serializer)Type serializer to use for contained values; can be null,
in which case 'this' serializer is returned as is vts)Factory(-like) method that can be used to construct a new container
serializer that uses specified |
| _dynamicValueSerializers | back to summary |
|---|---|
| protected PropertySerializerMap _dynamicValueSerializers If value type cannot be statically determined, mapping from runtime value types to serializers are stored in this object.
| |
| _property | back to summary |
|---|---|
| protected final BeanProperty _property Property that contains values handled by this serializer, if known; `null`
for root value serializers (ones directly called by
| |
| StdContainerSerializer | back to summary |
|---|---|
| protected StdContainerSerializer(Class<?> t) | |
| StdContainerSerializer | back to summary |
|---|---|
| protected StdContainerSerializer(Class<?> t, BeanProperty prop) | |
| StdContainerSerializer | back to summary |
|---|---|
| protected StdContainerSerializer(JavaType fullType, BeanProperty prop) | |
| StdContainerSerializer | back to summary |
|---|---|
| protected StdContainerSerializer(StdContainerSerializer<?> src) | |
| StdContainerSerializer | back to summary |
|---|---|
| protected StdContainerSerializer(StdContainerSerializer<?> src, BeanProperty prop) | |
| _findAndAddDynamic | back to summary |
|---|---|
protected ValueSerializer
| |
| _findAndAddDynamic | back to summary |
|---|---|
protected ValueSerializer
| |
| _withValueTypeSerializer | back to summary |
|---|---|
| protected abstract StdContainerSerializer Method that needs to be implemented to allow construction of a new
serializer object with given | |
| getContentSerializer | back to summary |
|---|---|
| public abstract ValueSerializer 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 abstract JavaType getContentType() Accessor for finding declared (static) element type for type this serializer is used for. | |
| hasSingleElement | back to summary |
|---|---|
| public abstract boolean hasSingleElement(T value) Method called to determine if the given value (of type handled by this serializer) contains exactly one element. Note although it might seem sensible to instead define something like "getElementCount()" method, this would not work well for containers that do not keep track of size (like linked lists may not).
Note, too, that this method is only called by serializer
itself; and specifically is not used for non-array/collection types
like | |
| isEmpty | back to summary |
|---|---|
| public abstract boolean isEmpty(SerializationContext prov, T value) Overrides tools. Doc from tools. Method called to check whether given serializable value is considered "empty" value (for purposes of suppressing serialization of empty values). Default implementation will consider only null values to be empty.
| |
| withValueTypeSerializer | back to summary |
|---|---|
| public StdContainerSerializer Factory(-like) method that can be used to construct a new container
serializer that uses specified
| |