Class YamlToXmlExtensions


  • public final class YamlToXmlExtensions
    extends java.lang.Object
    The class YamlToXmlExtensions helps to transform a given yaml string to an xml string.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String toXml​(java.lang.String yamlString)
      Transform the given yaml as String object to a xml as String object
      static java.lang.String toXml​(java.lang.String yamlString, int indent)
      Transform the given yaml as String object to a xml as String object
      static java.lang.String toXml​(java.lang.String yamlString, int indent, boolean withHeader)
      Transform the given yaml as String object to a xml as String object
      static java.lang.String toXml​(java.lang.String yamlString, int indent, boolean withHeader, boolean withRootTag, java.lang.String rootTagName)
      Transform the given yaml as String object to a xml as String object
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • toXml

        public static java.lang.String toXml​(java.lang.String yamlString)
                                      throws org.json.JSONException,
                                             com.fasterxml.jackson.core.JsonProcessingException
        Transform the given yaml as String object to a xml as String object
        Parameters:
        yamlString - the yaml as String 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 key
        com.fasterxml.jackson.core.JsonProcessingException - If an error occurs when converting object to String
      • toXml

        public static java.lang.String toXml​(java.lang.String yamlString,
                                             int indent)
                                      throws org.json.JSONException,
                                             com.fasterxml.jackson.core.JsonProcessingException
        Transform the given yaml as String object to a xml as String object
        Parameters:
        yamlString - the yaml as String object
        indent - 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 key
        com.fasterxml.jackson.core.JsonProcessingException - If an error occurs when converting object to String
      • toXml

        public static java.lang.String toXml​(java.lang.String yamlString,
                                             int indent,
                                             boolean withHeader)
                                      throws org.json.JSONException,
                                             com.fasterxml.jackson.core.JsonProcessingException
        Transform the given yaml as String object to a xml as String object
        Parameters:
        yamlString - the yaml as String object
        indent - the indent is the number of spaces to add to each level of indentation
        withHeader - 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 key
        com.fasterxml.jackson.core.JsonProcessingException - If an error occurs when converting object to String
      • toXml

        public static java.lang.String toXml​(java.lang.String yamlString,
                                             int indent,
                                             boolean withHeader,
                                             boolean withRootTag,
                                             java.lang.String rootTagName)
                                      throws org.json.JSONException,
                                             com.fasterxml.jackson.core.JsonProcessingException
        Transform the given yaml as String object to a xml as String object
        Parameters:
        yamlString - the yaml as String object
        indent - the indent is the number of spaces to add to each level of indentation
        withHeader - the flag that indicates if a xml header should be added
        withRootTag - the flag that indicates if a root tag will be added
        rootTagName - 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 key
        com.fasterxml.jackson.core.JsonProcessingException - If an error occurs when converting object to String