GsonBuilder builder = new GsonBuilder();
builder.setPrettyPrinting();
builder.serializeNulls();
builder.enableComplexMapKeySerialization();
builder.registerTypeAdapter(ImmutableList.class, new ImmutableListDeserializer());
builder.registerTypeAdapter(ImmutableMap.class, new ImmutableMapDeserializer());
builder.registerTypeAdapter(ImmutableSet.class, new ImmutableSetDeserializer());
builder.registerTypeAdapter(Document.class, new PropertyBasedInterfaceDeserializer());
builder.registerTypeAdapter(RMIAnswer.class, new RMIAnswer.Deserializer());
builder.registerTypeAdapter(Article.class, new PropertyBasedInterfaceDeserializer());
For some reason, when adding the Deserializer (!) for Document.class (which is abstract), only the members of the abstract class are serialized, not the members of the actual type.
I have no custom serializer or TypeAdapters anywhere in my code.
What am i doing wrong?
Thank you
- fabian