I’m looking to update our project’s jaxb version from 1 to 2. Has anyone tried doing this on their projects and are there any tips that anyone wanting to do this? I understand that each project is unique, I’m just looking for general tips.
Share
JAXB2 will generate enum classes for simpletype restrictions. Any Java code which relies on setting string values for uses of these types will require you to use the appropriate enum instead. I think this is great, since you get the typechecking when compiling rather than a validation warning at runtime.
JABX2 uses typed lists instead of untyped lists, so you can remove a lot of casting from your java code.
Date support is greatly improved. IIRC, most of the date types in JAXB1 generate Calendar, whereas in JAXB2 they generate XMLGregorianCalendar.