users@jersey.java.net

JAXBContext Configuration

From: Eric Axley <solway01_at_gmail.com>
Date: Fri, 5 Mar 2010 14:44:27 -0500

I am writing an application that will have several data types that need to
be converted to json. Many of the fields need to be "nonstrings" some are
booleans and some are strings that need to have no quotes. It appears that
the common way to handle this is to implement ContextResolver<JAXBContext>
and configure a MappedBuilder to handle the fields appropriately. While
this works, it is tedious to define my class in one file with all the JAXB
annotations, and then switch to the JAXBContextResolver to configure JSON
specific stuff. I'm a big fan of having all my configuration related to a
single task in one place.

Does anyone know if there are existing annotations I could use on the domain
object to specify that a field should be a nonstring? I have started
implementing my own, but I don't want to duplicate the effort if a solution
already exists.

--
Eric