简单框架忽略列表中的空XML元素

简单框架忽略列表中的空XML元素,xml,simple-framework,Xml,Simple Framework,当反序列化一个简单的字符串列表时,simple Framework只会忽略空标记,并且只包含非空值。如何解决这个问题 我想要这个XML部分 <type> <inflection></inflection> <inflection></inflection> <inflection>example</inflection> <inflection></inflect

当反序列化一个简单的字符串列表时,simple Framework只会忽略空标记,并且只包含非空值。如何解决这个问题

我想要这个XML部分

<type>
    <inflection></inflection>
    <inflection></inflection>
    <inflection>example</inflection>
    <inflection></inflection>
    <inflection></inflection>
    <inflection></inflection>
    <inflection></inflection>
</type>

您可以测试它的相反方向是否有助于您:

如果没有,您可以使用如下的

public class Type {
    ...
    @ElementList(inline = true, entry = "inflection")
    private List<String> inflections = new ArrayList<String>();
    ...
}