Jaxb marshaller always writes xsi:nil (even when @XmlElement(required=false, nillable=true))

I have a java property annotated with @XmlElement(required=false, nillable=true). When the object is marshalled to xml, it is always outputted with the xsi:nil="true" attribute.

Is there a jaxbcontext/marshaller option to direct the marshaller not to write the element, rather than write it with xsi:nil?

I've looked for answers to this and also had a look at the code, afaics, it will always write xsi:nil if nillable = true. Am I missing something?

11
задан dur 23 December 2015 в 23:02
поделиться