Class JSONUtil

java.lang.Object
fr.paris.lutece.plugins.rest.util.json.JSONUtil

public final class JSONUtil extends Object
JSON Utils
  • Method Details

    • model2Json

      public static String model2Json(Map model)
      Convert a model into a JSON formatted string
      Parameters:
      model - The model
      Returns:
      The JSON string
    • json

      public static com.fasterxml.jackson.databind.node.ObjectNode json(Map model)
      Convert a model into a JSON object
      Parameters:
      model - The model
      Returns:
      The JSON Object
    • formatError

      public static String formatError(String strMessage, int nCode)
      Format error as JSON
      Parameters:
      strMessage - the error message
      nCode - The error code
      Returns:
      The formatted string