Gson deserialize complex object with recursive dependencies
问题 I have several classes that contain a recursive dependency on each other and I serialize them to JSON format with Gson GraphAdapterBuilder, and it works perfectly. Now I want to deserialize them into the same structure but can't find out how. I've made an example: class ClassA{ public int field; public ClassB parent; public ClassA(int f, ClassB p){ field = f; parent = p; } } class ClassB{ public Vector<ClassA> vector = new Vector<ClassA>(); } ... ClassB b = new ClassB(); ClassA a1 = new