java.lang.String s.
Since this is one of "native" types, no type information is ever included on serialization (unlike for most scalar types as of 1.5)
| Modifier and Type | Field and Description |
|---|---|
| public static final StringSerializer |
| 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 final void | serializeWithType(Object value, JsonGenerator gen, SerializationContext provider, 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. |
| instance | back to summary |
|---|---|
| public static final StringSerializer instance | |
| StringSerializer | back to summary |
|---|---|
| public StringSerializer() | |
| 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 final void serializeWithType(Object value, JsonGenerator gen, SerializationContext provider, TypeSerializer typeSer) throws JacksonException Overrides tools. Doc from 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.
| |