Hi Eric,
There is no current behavior supported that you describe.
Jakub created another convention, JAXB natural convention, that
requires much less configuration, and that might work for you.
However, using Jackson may be the best option for you if you do not
require specific JAXB features for serializing JSON.
Paul.
On Mar 5, 2010, at 8:44 PM, Eric Axley wrote:
> 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
>