My question is simple, but there is nothing I can do about it.
I have a list class and an input class for XML serialization:
@Root(name = "entries")
public class List {
@ElementList(required = false, entry = "entry", inline = true, empty = true)
private List<Entry> entries;
}
@Root
public class Entry {
@Element(name = "entry_id", required = true)
private long id;
@Element(name = "text", required = true)
private String Text;
}
I am trying to parse this XML that has no entries in the list:
<entries>
<entry />
<entries>
The following error is returned:
W/System.err(3335): org.simpleframework.xml.core.ValueRequiredException: Unable to satisfy @org.simpleframework.xml.Element(data=false, name=entry_id, required=true, type=void) on field 'id' private long com.android.apps.model.Entry.id for class com.android.apps.model.Entry at line 2
What am I doing wrong? ElementList is set to empty = true and required = false. can anyone help?
source
share