/ Published in: Groovy

Example of JAXB-annotated POGO, marshalled and unmarshalled via static methods of JAXB object.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
import javax.xml.bind.annotation.* import javax.xml.bind.JAXB @XmlRootElement @XmlAccessorType(XmlAccessType.FIELD) // without this annotation you'll see IllegalAnnotationException when try to marshall Band() {} // no-argument constaructor is required for POGO name = n establishedYear = e } "$name founded in $establishedYear" } } // let's save // and then load
URL: jaxb_groovy
Comments
