What i need to do is the following. i need using json, to serialize my object to xml as follows:
<employee>
<name>Name</name>
<id>the_database_id</id>
<employee>
my java code/bean is as follows:
public class PairPOJO<K,V> implements IPair<K,V> {
private K first;
private V second;
...
}
for reasons irrelevant for my problem, firtst/second need to remain with these names...
so the serialization produces
<employee>
<first>Name</first>
<second>the_database_id</second>
<employee>
I am new to json, is there any bean annotation or any other way letting me to accomplish what i need to do? any site, example, info is highly appreciated.
My code snippet is...
and
Is there any better way for me to serialize to xml from complex objects? As i said it is the first time i need to do something similar and got over web that this is the best/better way to do it.
The general idea is that i need to return through REST ws beans.