I am new in JAXB and I would like to do something i don't know if it's doable. I have a java class to marshall like this :
@XmlAccessorType(XMLAccessType.NONE)
public class MyClass {
@XmlElement
private String a = "x";
@XmlElement
private String b = "xx";
@XmlElement
private boolean c = true;
...
}
and want XML output like this :
<?xml ...?>
<MyClass>
<a>x</a>
<b>xx</b>
<c value="true"/>
</MyClass>
One solution i have in mind is to use a boolean wrapper class to make it work, but i would like to avoid this as it takes me away the ability to use boolean primitive true, false.
Can we do that in JAXB?