Almost everything is good, I see two little mistakes.
First:
You don't need @Root (name = "entry/author")
just @Root (name = "author")
You should not depend of the parent of where it is going to be placed your class.
Second One
@ElementList(inline = true, type = String.class, entry = "entry")
private List<Entry> entries;
Should Be
@ElementList(inline = true, type = WhatsNewFeed_entry.class, entry = "entry")
private List<WhatsNewFeed_entry > entries;
In fact I think you just need
@ElementList(inline = true, entry = "entry")
private List<WhatsNewFeed_entry > entries;
because you are already specifying the collection name in List<WhatsNewFeed_entry >
The mistake is that you aren't specifying what class to Use, you was Specifying it as a String, that's why I asked what was "Entry" you wasn't telling the Serializer to use the
WhatsNewFeed_entry
After that, it should work for you
As an additional oppinion, I don't really like the @Root
because you are forcing the class to have an specific node name neither to force the properties or fields to be named as the XML expected tags , I think is a better approach to name it in the element, its more clear, you feel that you are making a real XML. And you design your classes as you
I'm not very good with java, come from C# world but it's so similar.
I would rewrite it a little like this:
//First level
@Root (name = "feed")
public class Feed { // All lines
@Element("id")
private String id;
@Element("author")
private Author_feed author;
@Element("title")
private String title;
@Element("updated")
private String updated;
@ElementList(inline = true, entry = "entry")
private List<WhatsNewFeed_entry> entries;
}
//Note that there is no root because it was already defined in the first level,
//this way you can use the same class in differents node with different tag names, you
//could even make an abstract class of author and in one just post the uri class isntead of
// 2 author classes with the same properties
public class Author_feed { // Lines 03-07
@Element("name")
private String name;
@Element("uri")
private String uri;
@Element("id")
@Namespace(prefix = "y")
private String id;
}
class Author_entry { // Lines 12-15
@Element("name")
private String name;
@Element("id")
@Namespace(prefix = "y")
private String id;
}
public class WhatsNewFeed_entry { // Lines 10-16
@Element (name = "id")
private String id_entry;
@Element("author")
private Author_entry author;
}
Hope it helps you to understand what was missing