I have long read about creating xml from Java using annotations, but right now I can not find a simple example.
If I want to create an xml file, for example:
<x:element uid="asdf">value</x:element>
from my java class:
public class Element {
private String uid = "asdf";
private String value = "value";
}
What annotations should I use to accomplish this? (I have an xml scheme if this helps the generation)
- update
There are annotations in the javax.xml.bind.annotation package "but I still haven't found what I was looking for": an example of use .. :)
source
share