Jackson: creare un deserializzatore JSON custom con le classi StdDeserializer e JsonToken

Nel post precedente abbiamo visto come creare con Jackson un serializzatore JSON personalizzato, al fine di poter gestire nel modo desiderato gli oggetti di una determinata classe ed ottenere una loro rappresentazione diversa da quella di default. Questo nuovo articolo è la sua naturale continuazione,… (Read the full article)

Jackson: create and register a custom JSON serializer with StdSerializer and SimpleModule classes

During Java objects JSON serialization sometimes we may need to change the default behavior and provide a customized representation of a class object or a collection. In this new (article about Jackson library we see how to implement a custom serializer, starting once again with a concrete example.… (Read the full article)

Jackson: creare e registrare un serializzatore JSON custom con le classi StdSerializer e SimpleModule

In fase di serializzazione JSON di oggetti Java a volte si può avere la necessità di modificare il comportamento di default e di fornire una determinata rappresentazione personalizzata di un oggetto di una classe o di una collection. In questo ennesimo articolo sulla libreria Jackson vediamo come… (Read the full article)

Jackson: set BigDecimal as type for JSON deserialization of decimal numbers

In the JSON serialization of a decimal number, Jackson creates an object of the exact actual type used when the field is defined in the class. If the field is defined by a generic type or by an abstraction, Jackson as default deserializes the value as Double.
In the following example we define in our class… (Read the full article)

Jackson: impostare BigDecimal come tipo per la deserializzazione JSON di numeri decimali

Nella deserializzazione JSON di un numero decimale, Jackson genera un oggetto del tipo concreto esatto con cui il campo è definito nella classe. Qualora il campo sia definito da un tipo generico o da un’astrazione, di default Jackson deserializza il valore come Double.
Nell’esempio… (Read the full article)

Jackson: using @JsonIgnore and @JsonProperty annotations to exclude a property only from JSON deserialization

In the previous article we saw how and where to use the Jackson @JsonIgnore annotation to exclude a property of an Java object from the JSON serialization. Not being available, the value of that property, during deserialization will be set to the default value in accordance with its type. In this case,… (Read the full article)

Jackson: utilizzare le annotations @JsonIgnore e @JsonProperty per escludere una proprietà solo dalla deserializzazione JSON

Nell’articolo precedente abbiamo visto come e dove utilizzare l’annotation @JsonIgnore di Jackson per escludere una proprietà di un oggetto Java dal processo di serializzazione JSON. Non essendo disponibile, il valore di tale proprietà, in fase di deserializzazione, verrà settato… (Read the full article)

Jackson JSON: difference between @JsonIgnore and @JsonIgnoreProperties annotations

Jackson has two different annotations to use when you want to exclude some class members from the JSON serialization and deserialization processes. These two annotations are @JsonIgnore and @JsonIgnoreProperties.
@JsonIgnoreProperties is an annotation at the class level and it expects that … (Read the full article)

Jackson JSON: differenza tra le annotations @JsonIgnore e @JsonIgnoreProperties

Jackson mette a disposizione due diverse annotazioni da utilizzare quando si vogliono escludere dai processi di serializzazione e deserializzazione JSON alcuni membri delle classi. Queste due annotazioni sono @JsonIgnore e @JsonIgnoreProperties.
@JsonIgnoreProperties è un’annotazione… (Read the full article)

Jackson JSON: deserialize a list of objects of subclasses of an abstract class

In this post we see how to serialize and deserialize in JSON a Java class that declares an instance variable consisting in a list of objects of an abstract class that contains objects of its various concrete subclasses.
We start by creating our abstract class:

public abstract class MyItem {

    private int
(Read the full article)