References Deprecated
StdSerializer is deprecated or references (maybe indirectly) at least one deprecated element.
See corresponding docs for further information.
Converter, and then this delegate value is serialized by Jackson.
Note that although types may be related, they must not be same; trying to do this will result in an exception.
| Modifier and Type | Field and Description |
|---|---|
| protected final Converter | |
| protected final JsonSerializer | _delegateSerializer
Underlying serializer for type |
| protected final JavaType | _delegateType
Fully resolved delegate type, with generic information if any available. |
| Access | Constructor and Description |
|---|---|
| public | |
| public <T> | |
| public | StdDelegatingSerializer(Converter<Object, ?> converter, JavaType delegateType, JsonSerializer<?> delegateSerializer)
|
| Modifier and Type | Method and Description |
|---|---|
| protected JsonSerializer | _findSerializer(Object value, SerializerProvider serializers)
Helper method used for locating serializer to use in dynamic use case, where
actual type value gets converted to is not specified beyond basic
|
| public void | acceptJsonFormatVisitor(JsonFormatVisitorWrapper visitor, JavaType
Type of element (entity like property) being visited typeHint)Overrides com. Implements com. Get the representation of the schema to which this serializer will conform. |
| protected Object | Returns: Result of conversionValue to convert value)Method called to convert from source Java value into delegate value (which will be serialized using standard Jackson serializer for delegate type)
The default implementation uses configured |
| public JsonSerializer | createContextual(SerializerProvider
Serializer provider to use for accessing config, other serializers provider, 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. Method called to see if a different (or differently configured) serializer is needed to serialize values of specified property. |
| protected Converter | |
| public JsonSerializer | getDelegatee()
Overrides com. Accessor that can be used to determine if this serializer uses another serializer for actual serialization, by delegating calls. |
| 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 JsonNode | getSchema(SerializerProvider
The serializer provider. provider, Type A hint about the type. typeHint, boolean Is the type optional isOptional)Overrides com. Implements com.
Deprecated
Since 2.15
Default implementation simply claims type is "string"; usually overriden by custom serializers. |
| public boolean | isEmpty(SerializerProvider prov, Object value)
Overrides com. Method called to check whether given serializable value is considered "empty" value (for purposes of suppressing serialization of empty values). |
| public void | resolve(SerializerProvider
Provider that has constructed serializer this method
is called on. provider)Implements com. Method called after |
| public void | serialize(Object
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. Method that can be called to ask implementation to serialize values of type this serializer handles. |
| public void | serializeWithType(Object
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, TypeSerializer Type serializer to use for including type information typeSer)Overrides 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. |
| protected StdDelegatingSerializer | withDelegate(Converter<Object, ?> converter, JavaType delegateType, JsonSerializer<?> delegateSerializer)
References Deprecated
StdDelegatingSerializer is deprecated or references (maybe indirectly) at least one deprecated element.
Method used for creating resolved contextual instances. |
| _converter | back to summary |
|---|---|
| protected final Converter<Object, ?> _converter | |
| _delegateSerializer | back to summary |
|---|---|
| protected final JsonSerializer<Object> _delegateSerializer Underlying serializer for type | |
| _delegateType | back to summary |
|---|---|
| protected final JavaType _delegateType Fully resolved delegate type, with generic information if any available. | |
| StdDelegatingSerializer | back to summary |
|---|---|
public StdDelegatingSerializer(Converter<?, ?> converter)
| |
| StdDelegatingSerializer | back to summary |
|---|---|
public <T> StdDelegatingSerializer(Class<T> cls, Converter<T, ?> converter)
| |
| StdDelegatingSerializer | back to summary |
|---|---|
public StdDelegatingSerializer(Converter<Object, ?> converter, JavaType delegateType, JsonSerializer<?> delegateSerializer)
| |
| _findSerializer | back to summary |
|---|---|
| protected JsonSerializer Helper method used for locating serializer to use in dynamic use case, where
actual type value gets converted to is not specified beyond basic
| |
| acceptJsonFormatVisitor | back to summary |
|---|---|
| public void acceptJsonFormatVisitor(JsonFormatVisitorWrapper visitor, JavaType typeHint) throws JsonMappingException Overrides com. Implements com. Doc from com. Get the representation of the schema to which this serializer will conform. | |
| convertValue | back to summary |
|---|---|
| protected Object convertValue(Object value) Method called to convert from source Java value into delegate value (which will be serialized using standard Jackson serializer for delegate type)
The default implementation uses configured | |
| createContextual | back to summary |
|---|---|
| public JsonSerializer Implements com. Doc from com. Method called to see if a different (or differently configured) serializer is needed to serialize values of specified property. Note that instance that this method is called on is typically shared one and as a result method should NOT modify this instance but rather construct and return a new instance. This instance should only be returned as-is, in case it is already suitable for use.
| |
| getConverter | back to summary |
|---|---|
| protected Converter | |
| getDelegatee | back to summary |
|---|---|
| public JsonSerializer Overrides com. Doc from com. Accessor that can be used to determine if this serializer uses another serializer for actual serialization, by delegating calls. If so, will return immediate delegate (which itself may delegate to further serializers); otherwise will return null.
| |
| 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.
| |
| getSchema | back to summary |
|---|---|
| public JsonNode getSchema(SerializerProvider provider, Type typeHint, boolean isOptional) 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.
| |
| isEmpty | back to summary |
|---|---|
| public boolean isEmpty(SerializerProvider prov, Object value) Overrides com. Doc from com. 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. Note replaces
| |
| resolve | back to summary |
|---|---|
| public void resolve(SerializerProvider provider) throws JsonMappingException Implements com. Doc from com. Method called after Note that this method does NOT return serializer, since resolution is not allowed to change actual serializer to use.
| |
| serialize | back to summary |
|---|---|
| public void serialize(Object 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.
| |
| serializeWithType | back to summary |
|---|---|
| public void serializeWithType(Object value, JsonGenerator gen, 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.
| |
| withDelegate | back to summary |
|---|---|
| protected StdDelegatingSerializer withDelegate(Converter<Object, ?> converter, JavaType delegateType, JsonSerializer<?> delegateSerializer)
References Deprecated
See corresponding docs for further information. Method used for creating resolved contextual instances. Must be overridden when sub-classing. | |