I want to create an JAVA object, that could be converted into XML structure
<a id="[numeric value]">[string value]</a>
I read the tutorials on Xstream site and googled some time, but I can't find solutions.
For example, to convert the POJO to
<many_a>
<a id="[numeric value]">
<name>[string value]</name>
</a>
...
</many_a>
I will create POJOs
@XStreamAlias("many_a")
class AList{
@XStreamImplicit(itemFieldName = "a")
List<A> list;
}
class A{
@XStreamAsAttribute
@XStreamAlias("id")
long id;
@XStreamAlias("name")
String name;
}
So, the question is which POJO I should create to get the XML above?