In previous posts I have described the XML mapping document and JSON-binding extensions in EclipseLink JAXB (MOXy). Since MOXy has a JAXB model for its mapping document we were able to eat our own dog food, and now MOXy offers a JSON mapping document.
An external metadata representation is useful when:
An external metadata representation is useful when:
- You cannot modify the domain model (it may come from a 3rd party).
- You do not want to introduce compile dependencies on JAXB APIs (if you are using a version of Java prior to Java SE 6).
- You want to apply multiple JAXB mappings to a domain model (you are limited to one representation with annotations).
- Your object model already contains so many annotations from other technologies that adding more would make the class unreadable.