Skip to content
Advertisement

Tag: xml-deserialization

How to use setters in JAXB collections unmarshalling

I wan’t to deserialize XML to my POJO but something doing wrong… My POJO class: Marshalling example: XML output: Unmarshalling example: Console output: As you can see, citiesId is empty. It happens because JAXB unmarshalling calling the getter (copy of field in my case) and trying to set values into a copy of collection. How to make it create a

Advertisement