Class JSONUtil
- java.lang.Object
-
- fr.paris.lutece.plugins.rest.util.json.JSONUtil
-
public final class JSONUtil extends java.lang.ObjectJSON Utils
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.StringformatError(java.lang.String strMessage, int nCode)Format error as JSONstatic com.fasterxml.jackson.databind.node.ObjectNodejson(java.util.Map model)Convert a model into a JSON objectstatic java.lang.Stringmodel2Json(java.util.Map model)Convert a model into a JSON formatted string
-
-
-
Method Detail
-
model2Json
public static java.lang.String model2Json(java.util.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(java.util.Map model)
Convert a model into a JSON object- Parameters:
model- The model- Returns:
- The JSON Object
-
formatError
public static java.lang.String formatError(java.lang.String strMessage, int nCode)Format error as JSON- Parameters:
strMessage- the error messagenCode- The error code- Returns:
- The formatted string
-
-