Class JsonUtils

java.lang.Object
gov.niem.tools.api.core.utils.JsonUtils

public class JsonUtils extends Object
JSON-related utility functions.
  • Constructor Details

    • JsonUtils

      public JsonUtils()
  • Method Details

    • xmlToJson

      public static org.json.JSONObject xmlToJson(String xml)
      Converts an XML string to a JSON object.
    • saveObjectAsJson

      public static File saveObjectAsJson(Object object, Path path, String filenameBase) throws Exception
      Write object to JSON file.
      Parameters:
      filenameBase - Filename without the .json extension
      Throws:
      Exception
    • toString

      public static String toString(Object data) throws Exception
      Throws:
      Exception