I am currently attempting to implement some of the tricks described in this 
presentation 
<https://github.com/FasterXML/jackson-docs/wiki/Presentation:-Jackson-Performance#non-compatible-easy-pojos-as-json-arrays-jackson-21>
 to 
increase performance. I would like to be able to change a particular 
ObjectMapper instance to serialize all POJO's using a particular 
JsonFormat.Shape, which I haven't been able to discover how to do.

Currently (as a POC), I'm doing something like the following:

ClassPath.from(this.getClass().getClassLoader()).getTopLevelClasses(
"my.package")
                .stream()
                .forEach((c) -> {
                    MAPPER.configOverride(c.load())
                            .setFormat(JsonFormat.Value.forShape(JsonFormat.
Shape.ARRAY));
                });


This is obviously a temporary solution. Is there a way to configure the 
ObjectMapper to utilize a particular shape by default? Using annotations on 
the POJO's is currently not an option.

I'm using the latest Jackson (2.8.6).

-- 
You received this message because you are subscribed to the Google Groups 
"jackson-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to