| Modifier and Type | Field and Description |
|---|---|
| protected final String |
| Access | Constructor and Description |
|---|---|
| protected | |
| protected | |
| protected |
| Modifier and Type | Method and Description |
|---|---|
| protected StdContainerSerializer | _withValueTypeSerializer(TypeSerializer vts)
Implements abstract tools. Method that needs to be implemented to allow construction of a new
serializer object with given |
| public abstract void | acceptJsonFormatVisitor(JsonFormatVisitorWrapper visitor, JavaType typeHint)
Redeclares tools. Overrides tools. Default implementation specifies no format. |
| 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 ValueSerializer | |
| public abstract boolean | isEmpty(SerializationContext ctxt, T value)
Implements abstract tools. Method called to check whether given serializable value is considered "empty" value (for purposes of suppressing serialization of empty values). |
| public void | serialize(T value, JsonGenerator gen, SerializationContext ctxt)
Implements abstract tools. Method that can be called to ask implementation to serialize values of type this serializer handles. |
| protected abstract void | |
| public void | serializeWithType(T value, JsonGenerator gen, 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. |
| _schemeElementType | back to summary |
|---|---|
| protected final String _schemeElementType | |
| ContainerSerializerBase | back to summary |
|---|---|
| protected ContainerSerializerBase(Class<T> type, String schemaElementType) | |
| ContainerSerializerBase | back to summary |
|---|---|
| protected ContainerSerializerBase(JavaType type, String schemaElementType) | |
| ContainerSerializerBase | back to summary |
|---|---|
| protected ContainerSerializerBase(ContainerSerializerBase<?> src) | |
| _withValueTypeSerializer | back to summary |
|---|---|
| protected StdContainerSerializer Implements abstract tools. Doc from tools. Method that needs to be implemented to allow construction of a new
serializer object with given
| |
| acceptJsonFormatVisitor | back to summary |
|---|---|
| public abstract void acceptJsonFormatVisitor(JsonFormatVisitorWrapper visitor, JavaType typeHint) Redeclares tools. Overrides tools. Doc from tools. Default implementation specifies no format. This behavior is usually overriden by custom serializers.
| |
| 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.
| |
| getSerializer | back to summary |
|---|---|
| protected ValueSerializer | |
| isEmpty | back to summary |
|---|---|
| public abstract boolean isEmpty(SerializationContext ctxt, T value) Implements abstract 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.
| |
| serialize | back to summary |
|---|---|
| public void serialize(T value, JsonGenerator gen, SerializationContext ctxt) throws JacksonException Implements abstract tools. Doc from tools. 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, SerializationContext ctxt) throws JacksonException | |
| serializeWithType | back to summary |
|---|---|
| public void serializeWithType(T value, JsonGenerator gen, 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.
| |