My application used JAXB. It had all the POJO classes written for Marshalling and unmarshalling of XML. Now we got a new requirement from client to change this XML to YML. Is there a way to convert YML to that XML object of existing pojo classes.
I tried these dependencies:
<dependencies>
<dependency>
<groupId>org.yaml</groupId>
<artifactId>snakeyaml</artifactId>
<version>1.21</version>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.6.2</version>
</dependency>
</dependencies>
But they didn't help
Yaml yaml = new Yaml();
InputStream inputStream = new FileInputStream(boostrapFile);
System.out.println(inputStream);
Map<String, Object> map = yaml.load(inputStream);
System.out.println(map);
Gson gson = new Gson();
JsonElement jsonElement = gson.toJsonTree(map);
Bootstrap pojo = gson.fromJson(jsonElement, Bootstrap.class);
System.out.println(pojo.getDARCConfig());
Output:null