JsonGenerator
(and SerializerProvider if necessary).
Note that implementing this interface binds implementing object closely to Jackson API, and that it is often not necessary to do so -- if class is a bean, it can be serialized without implementing this interface.
Note that while it is possible to just directly implement JsonSerializable,
actual implementations are strongly recommended to instead extend
JsonSerializable..
| Modifier and Type | Class and Description |
|---|---|
| public abstract static class | JsonSerializable.
Base class with minimal implementation, as well as couple of extension methods that core Jackson databinding makes use of. |
| Modifier and Type | Method and Description |
|---|---|
| public void | serialize(JsonGenerator gen, SerializerProvider serializers)
Serialization method called when no additional type information is to be included in serialization. |
| public void | serializeWithType(JsonGenerator gen, SerializerProvider serializers, TypeSerializer typeSer)
Serialization method called when additional type information is expected to be included in serialization, for deserialization to use. |
| serialize | back to summary |
|---|---|
| public void serialize(JsonGenerator gen, SerializerProvider serializers) throws IOException Serialization method called when no additional type information is to be included in serialization. | |
| serializeWithType | back to summary |
|---|---|
| public void serializeWithType(JsonGenerator gen, SerializerProvider serializers, TypeSerializer typeSer) throws IOException Serialization method called when additional type information is expected to be included in serialization, for deserialization to use.
Usually implementation consists of a call to Note that some types (most notably, "natural" types: String, Integer, Double and Boolean) never include type information. | |
JsonSerializable.
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | isEmpty(SerializerProvider serializers)
Method that may be called on instance to determine if it is considered "empty" for purposes of serialization filtering or not. |
| Base | back to summary |
|---|---|
| public Base() | |
| isEmpty | back to summary |
|---|---|
| public boolean isEmpty(SerializerProvider serializers) Method that may be called on instance to determine if it is considered "empty" for purposes of serialization filtering or not. | |