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

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


         case ARRAY_STRING : {
            JsonValue jsonArray = new ArrayValue();
            int length = Array.getLength(object);
            for (int i = 0; i < length; i++)
            {
               jsonArray.addElement(new StringValue((String)Array.get(object, i)));
            }
            return jsonArray;
         }
         case ARRAY_OBJECT : {
            JsonValue jsonArray = new ArrayValue();
View Full Code Here


            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));
               }
View Full Code Here

               {
                  jsonArray.addElement(createJsonValue(el));
               }
               else
               {
                  jsonArray.addElement(createJsonObject(el));
               }
            }

            return jsonArray;
         }
View Full Code Here

            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));
               }
View Full Code Here

               {
                  jsonArray.addElement(createJsonValue(o));
               }
               else
               {
                  jsonArray.addElement(createJsonObject(o));
               }
            }

            return jsonArray;
         }
View Full Code Here

            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));
               }
View Full Code Here

               {
                  jsonObject.addElement(k, createJsonValue(o));
               }
               else
               {
                  jsonObject.addElement(k, createJsonObject(o));
               }
            }

            return jsonObject;
         default :
View Full Code Here

         // 1. Known types (primitive, String, array of primitive or String)
         // 2. Array of any object (expect for Java Bean)
         // 3. Collection<?>
         // 4. Map<String, ?>
         if (JsonUtils.getType(o) != null)
            jsonArray.addElement(createJsonValue(o));
         else
            jsonArray.addElement(createJsonObject(o));
      }
      return jsonArray;
   }
View Full Code Here

         // 3. Collection<?>
         // 4. Map<String, ?>
         if (JsonUtils.getType(o) != null)
            jsonArray.addElement(createJsonValue(o));
         else
            jsonArray.addElement(createJsonObject(o));
      }
      return jsonArray;
   }

   /**
 
View Full Code Here

      JsonValue jsonArray = new ArrayValue();
      int length = Array.getLength(array);
      if (t == Types.ARRAY_BOOLEAN)
      {
         for (int i = 0; i < length; i++)
            jsonArray.addElement(new BooleanValue(Array.getBoolean(array, i)));
      }
      else if (t == Types.ARRAY_BYTE)
      {
         for (int i = 0; i < length; i++)
            jsonArray.addElement(new LongValue(Array.getByte(array, i)));
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.