Changing default configurations specific to YamlWriter

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

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

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

Serializing Java object to YAML format

In this post under YamlBeans, I will show with an example of how to serialize a Java object to YAML format. Below is the complete code Main Code 1 import java.io.File; 2 import java.io.FileWriter; 3 import java.io.IOException; 4 import java.util.ArrayList; 5 import java.util.List; 6 7 import com.esotericsoftware.yamlbeans.YamlWriter; 8 9 public class YamlDemo1 { 10 public…… Continue reading Serializing Java object to YAML format