In this post under YamlBeans, I will explain with example how to change default configurations specific to YamlWriter. We take the help of YamlConfig.WriteConfig class. It is a inner static class. It has getters and setters that can be used to change default configurations specific to YamlWriter. For this example, we will use the below…… Continue reading Changing default configurations specific to YamlWriter
Month: December 2019
Changing default configurations specific to YamlReader
In this post under YamlBeans, I will explain with example how to change default configurations specific to YamlReader. We take the help of YamlConfig.ReadConfig class. It is a inner static class. It has getters and setters that can be used to change default configurations specific to YamlReader. For this example, we will use the below…… Continue reading Changing default configurations specific to YamlReader
Changing default configurations common to both YamlWriter and YamlReader
In this post under YamlBeans, I will explain with example how to change default configurations common to both YamlWriter and YamlReader. The YamlConfig class has getter and setters that can be used to change default configurations. For this example, we will use the below Employee1 class structure. Employee1 class import java.util.List; public class Employee1 {…… Continue reading Changing default configurations common to both YamlWriter and YamlReader
ExclusionStrategy example during deserialization of object
In this post under Gson, I will explain how we can exclude certain fields of a json data from being deserialized with an example. Below is the Employee class structure that will be used to create an instance and its field are set with the values obtained from Employee.json file. Employee class public class Employee…… Continue reading ExclusionStrategy example during deserialization of object
JMS 2.0 Simple Example
In this post, I will explain how to use JMS api with simple example. Note: I will be using JMS 2.0 api for this and future examples. Below is the complete main code Main Class 1 package package1; 2 3 import java.util.Properties; 4 5 import javax.jms.ConnectionFactory; 6 import javax.jms.Destination; 7 import javax.jms.JMSException; 8 import javax.naming.Context;…… Continue reading JMS 2.0 Simple Example
Listening to Skip events using SkipListener
In this post under Spring Batch, I will explain with an example of how to listen to skip events. The skip events are generated during reading, writing, and processing of records. We can listen to these skip events with the help of org.springframework.batch.core.SkipListener interface. The SkipListener interface has three methods1) onSkipInProcesspurpose –> provide implementation for…… Continue reading Listening to Skip events using SkipListener
ExclusionStrategy example during serialization of object
In this post under Gson, I will explain how we can exclude certain fields of a class from being serialized with an example. Below is the Employee class structure that we want to serialize Employee public class Employee { private int id; private String name; private int ssn; private boolean terminated; public int getId() {…… Continue reading ExclusionStrategy example during serialization of object
Deserializing YAML data to Java object
In this post under YamlBeans, I will show with an example of how to deserialize a YAML data to Java object. Main Code 1 import java.io.File; 2 import java.io.FileReader; 3 import java.io.IOException; 4 5 import com.esotericsoftware.yamlbeans.YamlReader; 6 7 public class YamlDemo2 { 8 public static void main(String[] args) { 9 File file = new File(“input1.yml”);…… Continue reading Deserializing YAML data to Java object