Deprecated
as a consequence of StdSerializer being deprecated. See corresponding docs for further information.
com.fasterxml.jackson.annotation.JsonValue annotation to
indicate that serialization should be done by calling the method
annotated, and serializing result it returns.Implementation Note
we will post-process resulting serializer
(much like what is done with BeanSerializer)
to figure out actual serializers for final types.
This must be done from createContextual method, and NOT from constructor;
otherwise we could end up with an infinite loop.
| Modifier and Type | Class and Description |
|---|---|
| pack-priv static class | JsonValueSerializer.TypeSerializerRerouter
Silly little wrapper class we need to re-route type serialization so that we can override Object to use for type id (logical type) even when asking serialization of something else (delegate type) |
| Modifier and Type | Field and Description |
|---|---|
| protected final AnnotatedMember | |
| protected transient PropertySerializerMap | _dynamicSerializers
If value type cannot be statically determined, mapping from runtime value types to serializers are cached in this object. |
| protected final boolean | _forceTypeInformation
This is a flag that is set in rare (?) cases where this serializer is used for "natural" types (boolean, int, String, double); and where we actually must force type information wrapping, even though one would not normally be added. |
| protected final Set | _ignoredProperties
Names of properties to ignore from Value class accessed using accessor. |
| protected final BeanProperty | |
| protected final JsonSerializer | |
| protected final JavaType | _valueType
Declared type of the value accessed, as declared by accessor. |
| protected final TypeSerializer |
| Access | Constructor and Description |
|---|---|
| public | JsonValueSerializer(AnnotatedMember accessor, TypeSerializer vts, JsonSerializer<?>
Explicit serializer to use, if caller knows it (which
occurs if and only if the "value method" was annotated with
ser, Set<String> ignoredProperties)com.), otherwise
null
|
| public | |
| public | |
| public | JsonValueSerializer(JsonValueSerializer src, BeanProperty property, TypeSerializer vts, JsonSerializer<?> ser, boolean forceTypeInfo)
Deprecated
as a consequence of
JsonValueSerializer being deprecated.
|
| Modifier and Type | Method and Description |
|---|---|
| protected boolean | Returns: True if method handled callbacks; false if not; in latter case caller will send default callbacksOverridable helper method used for special case handling of schema information for Enums. |
| protected JsonSerializer | |
| private static final Class | |
| protected static JsonSerializer | Returns: Configured serializer with specified properties ignoredSerializer to be configured ser, Set<String> ignoredProperties)Internal helper that configures the provided |
| public void | acceptJsonFormatVisitor(JsonFormatVisitorWrapper visitor, JavaType
Type of element (entity like property) being visited typeHint)Overrides com. Implements com. |
| public static JsonValueSerializer | construct(SerializationConfig config, AnnotatedMember accessor, TypeSerializer vts, JsonSerializer<?> ser)
Deprecated
as a consequence of
JsonValueSerializer being deprecated.
|
| public JsonSerializer | createContextual(SerializerProvider
Serializer provider to use for accessing config, other serializers ctxt, 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. |
| public JsonNode | getSchema(SerializerProvider
The serializer provider. ctxt, 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 boolean | isEmpty(SerializerProvider ctxt, Object bean)
Overrides com. |
| protected boolean | |
| public void | serialize(Object
Value to serialize; can not be null. bean, 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. ctxt)Implements abstract com. |
| public void | serializeWithType(Object
Value to serialize; can not be null. bean, 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. ctxt, TypeSerializer Type serializer to use for including type information typeSer0)Overrides com. |
| public String | |
| protected JsonValueSerializer | withResolved(BeanProperty property, TypeSerializer vts, JsonSerializer<?> ser, boolean forceTypeInfo)
Deprecated
as a consequence of
JsonValueSerializer being deprecated.
|