public final class JSONUtils extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
JSON_KEY_ERROR_MESSAGE |
static String |
JSON_KEY_FILE_EXTENSION |
static String |
JSON_KEY_FILE_NAME |
static String |
JSON_KEY_FORM_ERROR |
static String |
JSON_KEY_ID_ENTRY |
static String |
JSON_KEY_ID_FIELD |
static String |
JSON_KEY_ID_FORM |
static String |
JSON_KEY_ID_RESPONSE |
static String |
JSON_KEY_MANDATORY_ERROR |
static String |
JSON_KEY_MIME_TYPE |
static String |
JSON_KEY_RESPONSE |
static String |
JSON_KEY_TITLE_QUESTION |
static String |
JSON_KEY_VALUE_RESPONSE |
| Modifier and Type | Method and Description |
|---|---|
static fr.paris.lutece.plugins.genericattributes.business.GenericAttributeError |
buildFormError(String strJson)
Builds
GenericAttributeError from json string |
static String |
buildJson(fr.paris.lutece.plugins.genericattributes.business.GenericAttributeError formError)
Builds json form
GenericAttributeError |
static String |
buildJson(Map<Integer,List<fr.paris.lutece.plugins.genericattributes.business.Response>> mapResponse,
int nIdForm,
javax.servlet.http.HttpSession session)
Builds the json string for the response map
|
static net.sf.json.JSONObject |
buildJson(fr.paris.lutece.plugins.genericattributes.business.Response response,
javax.servlet.http.HttpSession session)
Builds the json string for the
Response |
static Map<Integer,List<fr.paris.lutece.plugins.genericattributes.business.Response>> |
buildListResponses(String strJSON,
Locale locale,
javax.servlet.http.HttpSession session)
Builds the responses list - null if
JSON_KEY_RESPONSE is
missing. |
static List<String> |
getBlobIds(String strJSON)
Get the list of blob id from a JSON string
|
static List<String> |
getBlobIds(String strJSON,
int nIdEntry)
Get the list of blob id from a JSON string
|
public static final String JSON_KEY_RESPONSE
public static final String JSON_KEY_ID_FORM
public static final String JSON_KEY_ID_ENTRY
public static final String JSON_KEY_ID_RESPONSE
public static final String JSON_KEY_ID_FIELD
public static final String JSON_KEY_VALUE_RESPONSE
public static final String JSON_KEY_FILE_NAME
public static final String JSON_KEY_FILE_EXTENSION
public static final String JSON_KEY_ERROR_MESSAGE
public static final String JSON_KEY_MANDATORY_ERROR
public static final String JSON_KEY_TITLE_QUESTION
public static final String JSON_KEY_FORM_ERROR
public static final String JSON_KEY_MIME_TYPE
public static String buildJson(Map<Integer,List<fr.paris.lutece.plugins.genericattributes.business.Response>> mapResponse, int nIdForm, javax.servlet.http.HttpSession session)
mapResponse - the response mapnIdForm - the id formsession - the sessionpublic static net.sf.json.JSONObject buildJson(fr.paris.lutece.plugins.genericattributes.business.Response response,
javax.servlet.http.HttpSession session)
Responseresponse - the responsesession - the sessionpublic static String buildJson(fr.paris.lutece.plugins.genericattributes.business.GenericAttributeError formError)
GenericAttributeErrorformError - GenericAttributeErrorpublic static List<String> getBlobIds(String strJSON, int nIdEntry)
strJSON - The JSON to get blob id fromnIdEntry - The id of the entry to get blob id from, or
FormUtils#CONSTANT_ID_NULL to get blob id from any
entrypublic static List<String> getBlobIds(String strJSON)
strJSON - The JSON to get blob id frompublic static fr.paris.lutece.plugins.genericattributes.business.GenericAttributeError buildFormError(String strJson)
GenericAttributeError from json stringstrJson - json stringGenericAttributeErrorpublic static Map<Integer,List<fr.paris.lutece.plugins.genericattributes.business.Response>> buildListResponses(String strJSON, Locale locale, javax.servlet.http.HttpSession session)
JSON_KEY_RESPONSE is
missing.strJSON - the jsonlocale - the localesession - the sessionJSON_KEY_RESPONSE is
missingCopyright © 2015 Mairie de Paris. All rights reserved.