Package io.github.astrapi69.json
Class JsonToYamlExtensions
- java.lang.Object
-
- io.github.astrapi69.json.JsonToYamlExtensions
-
public final class JsonToYamlExtensions extends java.lang.Object
The classJsonToYamlExtensions
helps 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.String
toYaml(java.io.File jsonFile)
Transforms the given json file into a yaml asString
objectstatic void
toYaml(java.io.File jsonFile, java.io.File resultYamlFile)
Transforms the given json file into a yaml asFile
objectstatic java.lang.String
toYaml(java.lang.String jsonString)
Transform the given json asString
object to a yaml asString
object
-
-
-
Method Detail
-
toYaml
public static java.lang.String toYaml(java.lang.String jsonString) throws com.fasterxml.jackson.core.JsonProcessingException
Transform the given json asString
object to a yaml asString
object- Parameters:
jsonString
- the json asString
object- Returns:
- the transformed yaml as
String
object - 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.IOException
Transforms the given json file into a yaml asString
object- Parameters:
jsonFile
- the json file- Returns:
- the transformed yaml as
String
object - 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.IOException
Transforms the given json file into a yaml asFile
object- Parameters:
jsonFile
- the json fileresultYamlFile
- the result file in yaml format- Throws:
java.io.IOException
- Signals that an I/O exception has occurred
-
-