TypeToken
won't help, its not made for that. If you want to handle circular references in Gson, you will need a TypeAdapterFactory
, but its not simple.
A better approach is probably to parse your JSon with Jackson (but I actually never used this functionality) : http://wiki.fasterxml.com/JacksonFeatureBiDirReferences