Jackson Goes All 1.1
Due to rapid speed of Jackson JSON
processor development, a significant new release of was just cut.
The release goes with catchy nickname "1.1" (given that 1.0 was to be
known as "Hazelnut", this could perhaps be known as "Macadamia", but I
Beyond obvious utility aspect (I use Jackson myself and want to start use some of new features at work, with the "official" version), this should also be good for getting feedback on some exciting new features (like JSON Schema generation).
Here are the highlights from 1.1 announcement (for more complete list, refer to full 1.1 release notes):
- Support for JAXB annotations: you can reuse existing JAXB-annotated beans; and support can optionally be combined with 'native' Jackson annotations (using AnnotationIntrospector.Pair for chaining)
- Ability to generate JSON Schema definitions using Jackson serializers on arbitrary POJO (package for schema is "org.codehaus.jackson.schema", part of Mapper jar, but it is invoked using ObjectMapper like all data mapping operations)
- Support for direct field access: public member fields and explicitly annotated fields (using @JsonProperty) can be serialized, deserialized. And unlike with JAXB, it is ok to find both field and methods (methods have precedence if this happens
- Annotation set has been streamlined: although all existing 1.0 annotations work (and will work for all 1.x releases); almost all functionality can be defined using but 3 new annotations:
- @JsonProperty for indicating getters/setters/accessible fields, and to override logical property name associated if need b
- @JsonSerialize to configure serialization (external serializer to use, whether to output null/non-default properties etc
- @JsonDeserialize to configure deserialization (external deserializer to use, sub-types to use)
Part of new functionality (namely, JAXB annotation support) lives in a brand new jar ("jackson-xc" aka "Xtra-Curricular stuff"); otherwise deployment aspects haven't changed.
With 1.1 done, development for 1.2 version can start next. There's a big
list of more functionality to implement -- but discussing that will be
worth a separate blog entry. Stay tuned!
(and remember to check out 1.1 JavaDocs at Codehaus: it's the easiest way to document things and I really try to make them useful)
ps. The Really Useful Backing Corporate Entity known as FasterXML.com offers full support for using this new version to maximum effect. Just in case you weren't aware of such support.