
Posted In: Jackson 2X, JSON
How to map multiple date formats using Jackson Mapper?
Use Case – I want to map multiple date formats to ObjectMapper while converting date string to POJO Maven – Jackson 2X Solution – Use @JsonFormat @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = “yyyy-MM-dd”, timezone = “IST”)
Read More
Posted In: Jackson 2X, JSON
How to map date format using Jackson Mapper
Use Case – I want to map particular date format to ObjectMapper while converting date string to POJO Maven – Jackson 2X Solution ObjectMapper .. mapper.setDateFormat(SimpleDateFormat);
Read More
Posted In: Jackson 2X, JSON
Is Jackson ObjectMapper threadsafe?
Use Case – I want to make only one/few ObjectMapper objects and share them in various classes. In this case we could use immutable ObjectReader and ObjectWriter classes Comment from ObjectWriter class Maven – Jackson 2X Solution – com.fasterxml.jackson.databind.ObjectWriter ObjectWriter objectWriter = mapper.writer(); ObjectReader objectReader = mapper.reader().forType(Employee.class);
Read MoreTags: Is it ok to declare ObjectMapper as a spring singleton?, Is it ok to declare ObjectMapper as a static field?

Posted In: Jackson 2X, JSON
Create custom serializer using Jackson 2.X
Use Case – While creating JSON from POJO I want to add additional logic or fields to the JSON. In the following example let us add full name which is concatenation of first name and last name. In such cases we could use Jackson custom serializer class. Maven – Jackson 2X Solution – com.fasterxml.jackson.databind.ser.std.StdSerializer Following […]
Read More
Posted In: Jackson 2X, JSON, XML
How to convert POJO to XML using Jackson library
Maven Dependency POJO Jackson 2X XmlMapper Result
Read More
Posted In: Jackson 2X, JSON, XML
How to convert XML to POJO using Jackson library
Maven Dependency POJO Jackson 2X XmlMapper Result
Read More

Posted In: Jackson 2X, JSON
Converting CSV to JSON using Jackson library
Maven Jackson 2X Classes used
Read MoreTags: CSV

Posted In: Jackson 2X, JSON
How to use Jackson 2.X to read big JSON file
Usecase – You have JSON data stored at a location. It is big so do not have luxury to read it fully in ObjectMapper or you just need use some part of JSON. Jackson API provides streaming JSON parser class to do that. Maven Jackson 2X Classes used from Jackson 2X import com.fasterxml.jackson.core.JsonFactory; import com.fasterxml.jackson.core.JsonParser; […]
Read MoreTags: Jackson JSON Streaming API Example

Posted In: Jackson 2X, JSON
Generate Json Schema from POJO – Jackson 2X
1. Example is using Address POJO with multiple fields. 2. Use com.fasterxml.jackson.module.jsonSchema.JsonSchemaGenerator class to get schema from POJO class 3. Schema generated
Read MoreTags: jackson - Generate JSON schema from java class, Jackson 2X
- Apache (13)
- Build Tools (2)
- Gradle (2)
- Caching (1)
- cpanel (1)
- cURL (1)
- Database (7)
- Hibernate (5)
- Java Core (38)
- Java Script (15)
- Bootstrap (1)
- File Upload (7)
- jQuery (3)
- React (3)
- JEE (13)
- JSON (41)
- GSON (13)
- Jackson 1X (1)
- Jackson 2X (12)
- jsoniter (1)
- Logging (2)
- Apache Commons Logging (1)
- Apache Log4J (1)
- Logback (1)
- SLF4J (1)
- MongoDB (1)
- OS (1)
- Linux (1)
- Security (5)
- Server (4)
- Tomcat (4)
- Service (2)
- Micro (2)
- Spring (46)
- Pattern (2)
- Spring Boot (20)
- Spring Data (4)
- Spring MVC (8)
- Spring REST (13)
- Spring Security (7)
- Testing (11)
- XML (5)
- JDOM XML Parser (1)