JAXB part 7: increase performance with singleton JaxbContext instance

Currently I am developing an application to rename some jboss configuration content. Using JAXB, I had made marshalling and unmarshalling methods, creating a new JAXBcontext instance each time the single methods were invoked (for each xml file!). The application was incredibly slow. Taking up to 45 minutes to complete the tasks. Then I have discovered […]

JAXB part 4: handling CDATA elements

If you want to specify that element values are CDATA, you can create an adapter class like this: import javax.xml.bind.annotation.adapters.XmlAdapter; In the bean class, generated by JAXB add the following annotation. In this way any occurrence of the elements with the annotation above will be automatically parsed as CDATA.