我使用骆驼(使用杰克逊解析)&在json中解析我的pojos,但我得到输出json:
{"com.xyz.Demo":{"key1":"val1","key2":"val2","fruits":
{"@serialization":"custom","unserializable-parents":"","list":{"default":
{"size":1},"int":1,"com.xyz.demo.Fruit":{"colour":"orange","timeStamp":"2020-
01-01T02:55:45Z"}}}}}
我只想要类名,而不是完整包。 也不想要:" @ serialization":" custom"," unserializable-parents":""
各个班级:
public class Demo {
private String key1 = null;
private String key2 = null;
private Fruits fruits = null;
}
public class Fruits extends ArrayList<Fruit> {
}
public class Fruit {
private String colour = null;
private String timeStamp = null;
}
Camel路线转换:.marshal()。json()
尝试用@JsonRootName注释模型类,没有用。