Package io.github.astrapi69.json
Class JsonToYamlExtensions
- java.lang.Object
-
- io.github.astrapi69.json.JsonToYamlExtensions
-
public final class JsonToYamlExtensions extends java.lang.ObjectThe classJsonToYamlExtensionshelps to transform a given json string to a yaml string
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.StringtoYaml(java.io.File jsonFile)Transforms the given json file into a yaml asStringobjectstatic voidtoYaml(java.io.File jsonFile, java.io.File resultYamlFile)Transforms the given json file into a yaml asFileobjectstatic java.lang.StringtoYaml(java.lang.String jsonString)Transform the given json asStringobject to a yaml asStringobject
-
-
-
Method Detail
-
toYaml
public static java.lang.String toYaml(java.lang.String jsonString) throws com.fasterxml.jackson.core.JsonProcessingExceptionTransform the given json asStringobject to a yaml asStringobject- Parameters:
jsonString- the json asStringobject- Returns:
- the transformed yaml as
Stringobject - Throws:
com.fasterxml.jackson.core.JsonProcessingException- If an error occurs when converting object to String
-
toYaml
public static java.lang.String toYaml(java.io.File jsonFile) throws java.io.IOExceptionTransforms the given json file into a yaml asStringobject- Parameters:
jsonFile- the json file- Returns:
- the transformed yaml as
Stringobject - Throws:
java.io.IOException- Signals that an I/O exception has occurred
-
toYaml
public static void toYaml(java.io.File jsonFile, java.io.File resultYamlFile) throws java.io.IOExceptionTransforms the given json file into a yaml asFileobject- Parameters:
jsonFile- the json fileresultYamlFile- the result file in yaml format- Throws:
java.io.IOException- Signals that an I/O exception has occurred
-
-