java.lang.Object
io.github.astrapi69.yaml.YamlToJsonExtensions
The class
YamlToJsonExtensions
helps to transform a given yaml string to a json string-
Method Details
-
toJson
-
toJson
public static String toJson(String yamlString, boolean prettyPrint) throws com.fasterxml.jackson.core.JsonProcessingException - Parameters:
yamlString
- the yaml asString
objectprettyPrint
- the flag that indicates if the output json string should be pretty formatted- Returns:
- the transformed json as
String
object - Throws:
com.fasterxml.jackson.core.JsonProcessingException
- If an error occurs when converting object to String
-
toJson
Transforms the given yaml file into a json asString
object- Parameters:
yamlFile
- the yaml file- Returns:
- the transformed json as
String
object - Throws:
IOException
- Signals that an I/O exception has occurred
-
toJson
Transforms the given yaml file into a json asString
object- Parameters:
yamlFile
- the yaml fileprettyPrint
- the flag that indicates if the output json string should be pretty formatted- Returns:
- the transformed json as
String
object - Throws:
IOException
- Signals that an I/O exception has occurred
-
toJson
Transforms the given yaml file into a json asFile
object- Parameters:
yamlFile
- the yaml fileresultJsonFile
- the result file in json format- Throws:
IOException
- Signals that an I/O exception has occurred
-