|
|
@ -33,8 +33,10 @@ class MyJsonComponent {
|
|
|
|
class Serializer : JsonSerializer<MyObject>() {
|
|
|
|
class Serializer : JsonSerializer<MyObject>() {
|
|
|
|
@Throws(IOException::class)
|
|
|
|
@Throws(IOException::class)
|
|
|
|
override fun serialize(value: MyObject, jgen: JsonGenerator, serializers: SerializerProvider) {
|
|
|
|
override fun serialize(value: MyObject, jgen: JsonGenerator, serializers: SerializerProvider) {
|
|
|
|
|
|
|
|
jgen.writeStartObject()
|
|
|
|
jgen.writeStringField("name", value.name)
|
|
|
|
jgen.writeStringField("name", value.name)
|
|
|
|
jgen.writeNumberField("age", value.age)
|
|
|
|
jgen.writeNumberField("age", value.age)
|
|
|
|
|
|
|
|
jgen.writeEndObject()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|