Jackson JSON: using @JsonPropertyOrder annotation to define properties serialization order

In the comments to a previous article a blog reader asked support for how to customize the order in which the properties of an object appear in the string resulting from its JSON serialization, using the Jackson library. In particular, in his case, he wanted to change the default order applied to the serialization… (Read the full article)

Jackson JSON: usare l’annotazione @JsonPropertyOrder per definire l’ordine di serializzazione delle proprietà

Nei commenti ad un precedente articolo un lettore ha chiesto supporto per sapere come fare, con la libreria Jackson, a personalizzare l’ordine con cui le proprietà di un oggetto compaiono nella stringa risultante dalla sua serializzazione JSON. In particolare, nel suo caso, voleva modificare… (Read the full article)

Jackson: how to exclude null value properties from JSON serialization

In the comments to a previous article about the Jackson library, it had been raised the question on how to exclude from the JSON serialization of a Java object properties that had a null value. Since it was not the first time I received a request for clarification on the subject, I decided to deal with it … (Read the full article)

Jackson: escludere le proprietà con valore null dalla serializzazione JSON

Nei commenti ad un precedente articolo sulla libreria Jackson (in inglese), era stata sollevata la domanda relativa a come escludere dalla serializzazione JSON di un oggetto Java le proprietà che avevano un valore null. Siccome non era la prima volta che arrivava una
richiesta di chiarimento sull’argomento,… (Read the full article)

Jackson: using @JsonSerialize (or @JsonDeserialize) annotation to register a custom serializer (or deserializer)

In a previous post we saw how to create a custom JSON serializer (and also a custom deserializer) with Jackson and how to register it using the SimpleModule class. This approach, only possible starting from version 1.7, is defined by Jackson wiki page as the “recommended way to register a custom… (Read the full article)

Jackson: usare le annotations @JsonSerialize/@JsonDeserialize per registrare un serializzatore/deserializzatore custom

In un post precedente abbiamo visto come creare con Jackson un serializzatore JSON personalizzato (e anche un deserializzatore) e come registrarlo utilizzando la classe SimpleModule. Tale approccio, possibile solo a partire dalla versione 1.7, è definito dalla relativa pagina wiki di Jackson(Read the full article)

Jackson: create a custom JSON deserializer with StdDeserializer and JsonToken classes

In the previous post we saw how to create a custom JSON serializer with Jackson, in order to handle in a desired way the objects of a given class and get a representation of them different from the default one. This new article is its natural continuation so we’ll analyze the opposite process, creating… (Read the full article)

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)