- public String convertPDToYaml(PropertyDefinition propertyDefinition) throws JsonParseException, JsonMappingException, IOException{
- String yamlContent = null;
- if(propertyDefinition != null){
- ObjectMapper mapper = new ObjectMapper(new YAMLFactory());
- mapper.disable(SerializationFeature.FAIL_ON_EMPTY_BEANS);
- yamlContent = mapper.writeValueAsString(propertyDefinition);
- }
- return yamlContent;
- }
-
- public String transformYamlToJson(String yaml) throws JsonParseException, JsonMappingException, IOException {
- ObjectMapper yamlReader = new ObjectMapper(new YAMLFactory());
- Object obj = yamlReader.readValue(yaml, Object.class);
- ObjectMapper jsonWriter = new ObjectMapper();
- jsonWriter.enable(SerializationFeature.INDENT_OUTPUT);
- return jsonWriter.writeValueAsString(obj);
- }
+ public String convertPDToYaml(PropertyDefinition propertyDefinition)
+ throws JsonParseException, JsonMappingException, IOException {
+ String yamlContent = null;
+ if (propertyDefinition != null) {
+ ObjectMapper mapper = new ObjectMapper(new YAMLFactory());
+ mapper.disable(SerializationFeature.FAIL_ON_EMPTY_BEANS);
+ yamlContent = mapper.writeValueAsString(propertyDefinition);
+ }
+ return yamlContent;
+ }