Here are some things you should change:
Class EmailAddresses
@Root(name = "EmailAddresses") /* 1 */
@Namespace(prefix = "t", reference = "INSERT YOUR REFERENCE HERE!") /* 2 */
public class EmailAddresses
{
@ElementList(inline = true) /* 3 */
private List<Entry> Entry;
// ...
}
Explanation:
/* 1 */
: Set the name of the element (case sensitive); simple does this per default, but so you can ensure it's really correct./* 2 */
: Set the namespace and it's reference; required for thet
in your XML./* 3 */
: Inline the list; the<t:EmailAddresses>
element is constructed out of the@Root()
element, all entries follow as inline-elements. Otherwise the list will create another element as child, wrapping it's entries.
Class Entry
@Root(name = "Entry") /* 1 */
@Namespace(prefix = "t", reference = "INSERT YOUR REFERENCE HERE!") /* 2 */
public class Entry
{
@Text
private String text; /* 3 */
@Attribute
private String Key;
// ...
}
Explanation:
/* 1 */
: Don't use@Element
here, use@Root()
./* 2 */
: As #2 above./* 3 */
: YourEntry
-tags in the XML contain text (= value of the element, like the "sip:..."), those require a mapping too. If the text is optional, you can use@Text(required = false)
to indicate that.
TIP: Create an instance of your list, fill it with entries and serialize it, e.g. into a file. So you can see if the mapping is matching your expectations, and where you have to do some corrections.