In this post under Gson. I will show how to deserialize a JSON data back to Java object using Gson framework. For our example I will use the below json data. The json data contains employee information. employee.json {“id”:1,”name”:”employee1″,”ssn”:1234} The class structure of Employee is as shown below Employee class public class Employee { private…… Continue reading Deserializing JSON to Java Object
Month: July 2019
Chaining multiple JobParametersValidator implementations
In this post under Spring Batch, I will show how to chain multiple JobParametersValidator interface implementations. For our example I will create two JobParametersValidator interface implementations as shown below Validator1 package xml.package21; import java.util.Map; import org.springframework.batch.core.JobParameter; import org.springframework.batch.core.JobParameters; import org.springframework.batch.core.JobParametersInvalidException; import org.springframework.batch.core.JobParametersValidator; public class Validator1 implements JobParametersValidator { @Override public void validate(JobParameters jobParameters) throws JobParametersInvalidException…… Continue reading Chaining multiple JobParametersValidator implementations
Accessing cache provider’s Cache implementation
This post explains how to access the cache provider’s Cache implementation through java cache api. In all my previous post related to Caching, I gave examples where I was accessing cache provider for caching functionality through the Java Cache API. The java cache api is set of specifications, which are implemented by cache providers and…… Continue reading Accessing cache provider’s Cache implementation
Parsing JSON data in a streaming way
In this post, I will explain how to parse JSON data using Gson framework. Each element whether start and end of the object, start and end of array, field name and field values are considered as tokens and are represented by JsonToken enums. The Gson framework parses the json data as a stream of tokens.…… Continue reading Parsing JSON data in a streaming way