--- /dev/null
+package com.pentila.entSavoie.utils;
+
+import com.liferay.portal.kernel.json.JSONArray;
+import com.liferay.portal.kernel.json.JSONException;
+import com.liferay.portal.kernel.json.JSONFactoryUtil;
+
+/**
+ * This class groups all the method to use on JSON object
+ * @author Alexandre Lef\8fvre
+ *
+ */
+public class JSONUtils {
+
+ /**
+ * String representing empty JSONa array
+ */
+ public static String EMPTY_JSON_ARRAY = "[]";
+ /**
+ * This method merge Json arrays in parameters
+ * @param arrs ths JSonArray object you want to merge
+ * @return the merged JSONArray
+ * @throws JSONException
+ */
+ public static JSONArray concatArray(JSONArray... arrs)
+ throws JSONException {
+
+ JSONArray result = JSONFactoryUtil.createJSONArray();
+
+ for (JSONArray arr : arrs) {
+ for (int i = 0; i < arr.length(); i++) {
+ result.put(arr.getJSONObject(i));
+ }
+ }
+ return result;
+ }
+
+}