|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectfr.paris.lutece.plugins.genericattributes.util.JSONUtils
public final class JSONUtils
Provides json utility methods for forms
| Field Summary | |
|---|---|
static String |
JSON_KEY_FIELD_NAME
JSON key for field name |
static String |
JSON_KEY_SUCCESS
JSON key to describe a success |
| Method Summary | |
|---|---|
static GenericAttributeError |
buildFormError(String strJson)
Builds GenericAttributeError from json string |
static String |
buildJson(GenericAttributeError formError)
Builds json form GenericAttributeError |
static void |
buildJsonError(net.sf.json.JSONObject json,
String strMessage)
Builds a json object with the error message. |
static net.sf.json.JSONObject |
buildJsonErrorRemovingFile(javax.servlet.http.HttpServletRequest request)
Builds a json object with the error message. |
static Map<Integer,List<Response>> |
buildListResponses(String strJSON,
Locale locale,
javax.servlet.http.HttpSession session)
Builds the responses list - null if JSON_KEY_RESPONSE is
missing. |
static net.sf.json.JSONObject |
getUploadedFileJSON(List<org.apache.commons.fileupload.FileItem> listFileItem)
Builds a json object for the file item list. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String JSON_KEY_FIELD_NAME
public static final String JSON_KEY_SUCCESS
| Method Detail |
|---|
public static Map<Integer,List<Response>> buildListResponses(String strJSON,
Locale locale,
javax.servlet.http.HttpSession session)
JSON_KEY_RESPONSE is
missing.
strJSON - the jsonlocale - the localesession - the session
JSON_KEY_RESPONSE is
missingpublic static String buildJson(GenericAttributeError formError)
GenericAttributeError
formError - GenericAttributeError
public static GenericAttributeError buildFormError(String strJson)
GenericAttributeError from json string
strJson - json string
GenericAttributeErrorpublic static net.sf.json.JSONObject getUploadedFileJSON(List<org.apache.commons.fileupload.FileItem> listFileItem)
JSON_KEY_UPLOADED_FILES, value is the array of uploaded
file.
listFileItem - the fileItem list
public static net.sf.json.JSONObject buildJsonErrorRemovingFile(javax.servlet.http.HttpServletRequest request)
request - the request
public static void buildJsonError(net.sf.json.JSONObject json,
String strMessage)
json - the JSONstrMessage - the error message
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||