instanceUpperCamelCaseWithTypeAdapterFactory() { final RuntimeTypeAdapterFactory<Animal> typeFactory = RuntimeTypeAdapterFactory
.of(Animal.class, “type")com.company.appname.data.model.Animal because it does
Gson g = (new GsonBuilder()).registerTypeAdapterFactory( .of(Shape.class我注意到,如果我调试代码并在RuntimeTypeAdapterFactory读和写方法中设置断点,它将命中read() (然后进入上面的失败),但它从未命中写方法。只是完全跳过了。
var blks = ReflectionHelper.getClasses("PACKAGE_NAME");
var blockRta = RuntimeTypeAdapterFactory.of(Block.classRuntimeTypeAdapterFactory是gson中的一个额外类,它的源代码可以查看。