Package iofXml

Class JsonMarshalKt

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Constructor Detail

    • Method Detail

      • iofV3XmlToJson

         final static String iofV3XmlToJson(String xml, Boolean validateXml)

        Convert an IOF V3 XML to JSON. If a value is not explicitly set in the XML document, the default value will be added to the JSON (as defined in the v3 XSD).

        Parameters:
        xml - any of the supported v3 XML types
        validateXml - if the XML string should be validated against IOF V3 XSD
        Returns:

        JSON representation of this XML

      • iofV2XmlToJson

         final static String iofV2XmlToJson(String xml)

        Convert an IOF V2 XML to JSON. If a value is not explicitly set in the XML document, the default value will be added to the JSON (as defined in the v2 DTD).

        Parameters:
        xml - any of the supported v2 XML types
        Returns:

        JSON representation of this XML

      • iofV3JsonToXml

         final static String iofV3JsonToXml(String json)

        Convert an IOF V3 JSON to XML.

        NB: Experimental. This function does not support 'Extensions', and may also have other datatypes it does not support.

        Parameters:
        json - JSON of any of the v3 root data types
        Returns:

        XML representation of the IOF JSON

      • iofV2JsonToXml

         final static String iofV2JsonToXml(String json)

        Convert an IOF V2 JSON to XML.

        NB: Experimental/unstable. failing for some types of data.

        Parameters:
        json - JSON of any of the v2 root data types
        Returns:

        XML representation of the IOF JSON

      • marshalIofObjectToJson

         final static String marshalIofObjectToJson(Object obj, Boolean prettyPrint)

        Serialize an IOF object (v3 or v2) to a JSON string

        Parameters:
        obj - previously unmarshalled JSON or XML string
        prettyPrint - should output be indented/prettified
        Returns:

        JSON representation of the object