java - How to serialize all int and boolean field to String with Jackson Json lib -


i'm working on aria2 jsonrpc remote revoke, , found out aria2 accept strings value, number 1 should "1".

although can use jsonserializer annotation or use module method, think there should easy way apply "int string serializer" of fields of type int.

could give me hint how this?

finally, found article has described 3 steps that, , thought may through answer:

  • create custom serializer extending stdserializer class

  • create object of simplemodule class, adding custom serializer , specifying class must used

  • register module on objectmapper instance

ref: jackson: create , register custom json serializer stdserializer , simplemodule classes


Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -