Comparison with Jackson
Juneau was developed independently from Jackson but shares many of the same features and capabilities. Whereas Jackson was created to work primarily with JSON, Juneau was created to work for multiple languages. Therefore, the terminology and annotations in Juneau are similar but language-agnostic.
The following charts describe equivalent features between the two libraries:
Annotations
| Jackson | Juneau |
|---|---|
@JsonGetter@JsonSetter | @MarshalledProp |
@JsonAnyGetter@JsonAnySetter | @MarshalledProp(name="*") |
@JsonIgnore@JsonIgnoreType | @MarshalledIgnore |
@JsonIgnoreProperties({...}) | @BeanType(excludeProperties|xp) |
@JsonAutoDetect(fieldVisibility=...) | No equivalent annotation but can be controlled via: MarshallingContext.Builder.beanFieldVisibility(Visibility) MarshallingContext.Builder.beanMethodVisibility(Visibility) |
@JsonCreator@JsonProperty | @BeanCtor |
@JacksonInject | No equivalent. |
@JsonSerialize@JsonDeserialize | Juneau uses swaps to convert non-serializable object to serializable forms: @Swap |
@JsonInclude | No equivalent annotation but can be controlled via various settings: MarshallingContext Serializer |
@JsonPropertyOrder | @BeanType(properties="...") |
@JsonValue@JsonRawValue | Can be replicated using swaps with Reader swapped values. |
@JsonView(MyView.class) | @MarshalledProp(view="MyView") — see View-Based Projection |
Hibernate / JPA
Jackson ships jackson-datatype-hibernate for ORM entity graphs. Juneau has no equivalent
module. Prefer DTOs; see JPA and Hibernate.