ToStringSerializer
as well as for custom subtypes that want to add processing for converting from
value to output into its String representation (whereas standard version
simply calls value object's toString() method).
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | acceptJsonFormatVisitor(JsonFormatVisitorWrapper visitor, JavaType typeHint)
Overrides tools. Implements tools. Default implementation specifies no format. |
| public boolean | isEmpty(SerializationContext prov, Object value)
Overrides tools. Method called to check whether given serializable value is considered "empty" value (for purposes of suppressing serialization of empty values). |
| public void | serialize(Object value, JsonGenerator gen, SerializationContext provider)
Implements abstract tools. Method that can be called to ask implementation to serialize values of type this serializer handles. |
| public void | serializeWithType(Object value, JsonGenerator g, SerializationContext ctxt, TypeSerializer typeSer)
Overrides tools. Default implementation will write type prefix, call regular serialization method (since assumption is that value itself does not need JSON Array or Object start/end markers), and then write type suffix. |
| public abstract String |
| ToStringSerializerBase | back to summary |
|---|---|
| public ToStringSerializerBase(Class<?> handledType) | |
| acceptJsonFormatVisitor | back to summary |
|---|---|
| public void acceptJsonFormatVisitor(JsonFormatVisitorWrapper visitor, JavaType typeHint) Overrides tools. Implements tools. Doc from tools. Default implementation specifies no format. This behavior is usually overriden by custom serializers.
| |
| isEmpty | back to summary |
|---|---|
| public boolean isEmpty(SerializationContext prov, Object 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.
| |
| serialize | back to summary |
|---|---|
| public void serialize(Object value, JsonGenerator gen, SerializationContext provider) throws JacksonException Implements abstract tools. Doc from tools. 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 g, SerializationContext ctxt, TypeSerializer typeSer) throws JacksonException Overrides tools. Default implementation will write type prefix, call regular serialization method (since assumption is that value itself does not need JSON Array or Object start/end markers), and then write type suffix. This should work for most cases; some sub-classes may want to change this behavior.
| |
| valueToString | back to summary |
|---|---|
| public abstract String valueToString(Object value) | |