java.lang.Object
io.github.astrapi69.yaml.YamlToXmlExtensions
The class
YamlToXmlExtensions
helps to transform a given yaml string to an xml string.-
Method Details
-
toXml
public static String toXml(String yamlString) throws org.json.JSONException, com.fasterxml.jackson.core.JsonProcessingException - Parameters:
yamlString
- the yaml asString
object- Returns:
- the transformed xml as
String
object - Throws:
org.json.JSONException
- if there is a syntax error in the source string or a duplicated keycom.fasterxml.jackson.core.JsonProcessingException
- If an error occurs when converting object to String
-
toXml
public static String toXml(String yamlString, int indent) throws org.json.JSONException, com.fasterxml.jackson.core.JsonProcessingException - Parameters:
yamlString
- the yaml asString
objectindent
- the indent is the number of spaces to add to each level of indentation- Returns:
- the transformed xml as
String
object - Throws:
org.json.JSONException
- if there is a syntax error in the source string or a duplicated keycom.fasterxml.jackson.core.JsonProcessingException
- If an error occurs when converting object to String
-
toXml
public static String toXml(String yamlString, int indent, boolean withHeader) throws org.json.JSONException, com.fasterxml.jackson.core.JsonProcessingException - Parameters:
yamlString
- the yaml asString
objectindent
- the indent is the number of spaces to add to each level of indentationwithHeader
- the flag that indicates if an xml header should be added- Returns:
- the transformed xml as
String
object - Throws:
org.json.JSONException
- if there is a syntax error in the source string or a duplicated keycom.fasterxml.jackson.core.JsonProcessingException
- If an error occurs when converting object to String
-
toXml
public static String toXml(String yamlString, int indent, boolean withHeader, boolean withRootTag, String rootTagName) throws org.json.JSONException, com.fasterxml.jackson.core.JsonProcessingException - Parameters:
yamlString
- the yaml asString
objectindent
- the indent is the number of spaces to add to each level of indentationwithHeader
- the flag that indicates if a xml header should be addedwithRootTag
- the flag that indicates if a root tag will be addedrootTagName
- the name of the root tag- Returns:
- the transformed xml as
String
object - Throws:
org.json.JSONException
- if there is a syntax error in the source string or a duplicated keycom.fasterxml.jackson.core.JsonProcessingException
- If an error occurs when converting object to String
-