3

I am planning to provide a interface to iOS Apps, the developer asked to add an additional field call class contains the name of the pojo I used on server so he can convert to his class on client easily. The problem is I have to do this when the json lib is processing the values.I think the registerJsonValueProcessor can do the trick. I got then class name by obj.getClass().getName() but I still have no idea how to attach it to json-lib.

Shisoft
  • 4,197
  • 7
  • 44
  • 61

1 Answers1

0

If you are using jackson for serialization/deserialization of json than please apply the annotation JsonTypeInfo on your class. It could help you
@JsonTypeInfo(use=Id.CLASS, include=As.PROPERTY, property="class")

Naveen Ramawat
  • 1,425
  • 1
  • 15
  • 27