Package org.exoplatform.ws.frameworks.json.value

Examples of org.exoplatform.ws.frameworks.json.value.JsonValue.addElement()


            int length = Array.getLength(object);
            for (int i = 0; i < length; i++)
            {
               Object el = Array.get(object, i);
               if (JsonUtils.getType(el) != null)
                  jsonArray.addElement(createJsonValue(el));
               else
                  jsonArray.addElement(createJsonObject(el));
            }

            return jsonArray;
View Full Code Here


            {
               Object el = Array.get(object, i);
               if (JsonUtils.getType(el) != null)
                  jsonArray.addElement(createJsonValue(el));
               else
                  jsonArray.addElement(createJsonObject(el));
            }

            return jsonArray;
         }
         case COLLECTION : {
View Full Code Here

            JsonValue jsonArray = new ArrayValue();
            List<Object> list = new ArrayList<Object>((Collection<?>)object);
            for (Object o : list)
            {
               if (JsonUtils.getType(o) != null)
                  jsonArray.addElement(createJsonValue(o));
               else
                  jsonArray.addElement(createJsonObject(o));
            }

            return jsonArray;
View Full Code Here

            for (Object o : list)
            {
               if (JsonUtils.getType(o) != null)
                  jsonArray.addElement(createJsonValue(o));
               else
                  jsonArray.addElement(createJsonObject(o));
            }

            return jsonArray;
         }
         case MAP :
View Full Code Here

            Set<String> keys = map.keySet();
            for (String k : keys)
            {
               Object o = map.get(k);
               if (JsonUtils.getType(o) != null)
                  jsonObject.addElement(k, createJsonValue(o));
               else
                  jsonObject.addElement(k, createJsonObject(o));
            }

            return jsonObject;
View Full Code Here

            {
               Object o = map.get(k);
               if (JsonUtils.getType(o) != null)
                  jsonObject.addElement(k, createJsonValue(o));
               else
                  jsonObject.addElement(k, createJsonObject(o));
            }

            return jsonObject;
         default :
            // Must not be here!
View Full Code Here

               {
                  // Get result of invoke method get...
                  Object invokeResult = method.invoke(object, new Object[0]);
                  if (JsonUtils.getType(invokeResult) != null)
                  {
                     jsonRootValue.addElement(key, createJsonValue(invokeResult));
                  }
                  else
                  {
                     jsonRootValue.addElement(key, createJsonObject(invokeResult));
                  }
View Full Code Here

                  {
                     jsonRootValue.addElement(key, createJsonValue(invokeResult));
                  }
                  else
                  {
                     jsonRootValue.addElement(key, createJsonObject(invokeResult));
                  }
               }
               catch (InvocationTargetException e)
               {
                  throw new JsonException(e.getMessage(), e);
View Full Code Here

         case ARRAY_BOOLEAN : {
            JsonValue jsonArray = new ArrayValue();
            int length = Array.getLength(object);
            for (int i = 0; i < length; i++)
            {
               jsonArray.addElement(new BooleanValue(Array.getBoolean(object, i)));
            }
            return jsonArray;
         }
         case ARRAY_BYTE : {
            JsonValue jsonArray = new ArrayValue();
View Full Code Here

         case ARRAY_BYTE : {
            JsonValue jsonArray = new ArrayValue();
            int length = Array.getLength(object);
            for (int i = 0; i < length; i++)
            {
               jsonArray.addElement(new LongValue(Array.getByte(object, i)));
            }
            return jsonArray;
         }
         case ARRAY_SHORT : {
            JsonValue jsonArray = new ArrayValue();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.