Tuesday, July 29, 2014

Java - JAXB marshalling and unmarshalling of ArrayList

Marshalling and unmarshalling of ArrayList using JAXB is rather simple however you cannot directly marshall ArrayList. You will need a holder class (wrapper class). It will hold the arraylist that you want to marshall or unmarshall.

Please see the self explanatory java code below -

Output -

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>


[one, two, three]

No comments:

Post a Comment