tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From José Luis Cetina <maxtorz...@gmail.com>
Subject Re: serializeAsArray JacksonJaxbJsonProvider
Date Mon, 20 Oct 2014 17:25:51 GMT
Thanks

2014-10-20 11:15 GMT-05:00 hwaastad <helge@waastad.org>:

> Hi,
> typical example:
>
> @Provider
> public class CustomJacksonJaxBJsonProvider extends JacksonJaxbJsonProvider
> {
>
>     private static ObjectMapper commonMapper = null;
>
>     public CustomJacksonJaxBJsonProvider() {
>         if (commonMapper == null) {
>             ObjectMapper mapper = new ObjectMapper();
>
>             mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
>
>
> mapper.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS,
> false);
>             mapper.configure(SerializationFeature.INDENT_OUTPUT, false);
>             mapper.configure(SerializationFeature.WRAP_ROOT_VALUE, false);
>
>
> mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
>             mapper.configure(DeserializationFeature.UNWRAP_ROOT_VALUE,
> false);
>
>             mapper.registerModule(new JaxbAnnotationModule());
>
>             commonMapper = mapper;
>         }
>         super.setMapper(commonMapper);
>     }
> }
>
> br hw
>
>
>
> --
> View this message in context:
> http://tomee-openejb.979440.n4.nabble.com/serializeAsArray-JacksonJaxbJsonProvider-tp4672427p4672498.html
> Sent from the TomEE Users mailing list archive at Nabble.com.
>



-- 
-------------------------------------------------------------------
*José Luis Cetina*
-------------------------------------------------------------------

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message