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 | @Beanp |
@JsonAnyGetter @JsonAnySetter | @Beanp(name="*") |
@JsonIgnore @JsonIgnoreType | @BeanIgnore |
@JsonIgnoreProperties({...}) | @Bean(excludeProperties|xp) |
@JsonAutoDetect(fieldVisibility=...) | No equivalent annotation but can be controlled via: BeanContext.Builder.beanFieldVisibility(Visibility) BeanContext.Builder.beanMethodVisibility(Visibility) |
@JsonCreator @JsonProperty | @Beanc |
@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: BeanContext Serializer |
@JsonPropertyOrder | @Bean(properties="...") @Bean(sort=x) |
@JsonValue @JsonRawValue | Can be replicated using swaps with Reader swapped values. |