Jackson @JsonCreator example – Deserialize with @JsonCreator

In this tutorial, we’re gonna look at ways to deserialize a Json string using @JsonCreator .

I. Maven Dependency

II. @JsonCreator

@JsonProperty is used to indicate the property name in JSON. This annotation can be used on a contructor or a factory method.

1. On Contructor

Customer class:

App class for testing:

>> Result:

2. On Factory Method

Customer class:

App class for testing:

>> Result:

By JavaSampleApproach | February 7, 2018.

Related Posts


Got Something To Say:

Your email address will not be published. Required fields are marked *

*