Software:
News ToolsReg Shops |
A practical guide to JAXB 2.0Take a peek at its new featuresPublished Friday 22nd September 2006 11:40 GMT Create an JAXBElement<CatalogType> catalogElement=factory.createCatalog(catalog); Marshal the Java object using the marshaller.marshal(catalogElement, new FileOutputStream(xmlDocument)); To run the Mapping Java to XML Using AnnotationsJAXB 2.0 has added the provision to marshal a Java object to an XML document using annotations. The annotations are defined in the To create the XML document, create an annotated class,
@XmlRootElement
@XmlType(name="", propOrder={"publisher", "edition", "title", "author"})
The annotation element @XmlAttribute public String journal; Define getter and setter methods for the different properties and the
In the marshalling class Click here for the resources file (zip) 5 comments posted — Comment period finished Please use mor recent versions of the JAXB RIPosted: 17:20 24th September 2006 Too late and not JRE backwards compatiblePosted: 18:38 24th September 2006 RE:Please use mor recent versions of the JAXB RIPosted: 00:13 25th September 2006 RE:Too late and not JRE backwards compatiblePosted: 00:18 25th September 2006 RE:Integrated StackPosted: 00:57 25th September 2006
Track this type of story as a custom Atom/RSS feed or by email.
|
|
||||||||
Top 20 stories • All The Week’s Headlines • Archive • Search