是否可以使用普通标签而不是自动关闭标签?
xml class:
@Root(name = "testsimple")
public static class TestSimple{
@Attribute(name = "id")
private int clientId;
@Attribute(name = "name")
private String clientName;
@Path("list")
@ElementList(inline=true)
private List<Feature> list;
}
@Root(name = "ad")
public static class Feature{
@Attribute(name = "id")
private String id;
@Attribute(name = "name")
private String name;
}
预期结果:
<testsimple id="id" name="name">
<list>
<feature id="id" name="name"></feature>
<feature id="id2" name="name2"></feature>
</list>
</testsimple>
实际结果:
<testsimple id="id" name="name">
<list>
<feature id="id" name="name"/>
<feature id="id2" name="name2"/>
</list>
</testsimple>