Package org.exoplatform.ws.frameworks.json.impl.JsonUtils

Examples of org.exoplatform.ws.frameworks.json.impl.JsonUtils.Types


    * @throws JsonException if any errors occurs.
    */
   @SuppressWarnings("unchecked")
   protected JsonValue createJsonValue(Object object) throws JsonException
   {
      Types t = JsonUtils.getType(object);
      switch (t)
      {
         case NULL :
            return new NullValue();
         case BOOLEAN :
View Full Code Here


            {
               method.invoke(object, new Object[]{createObjectKnownTypes(methodParameterClazz, childJsonValue)});
            }
            else
            {
               Types type = JsonUtils.getType(methodParameterClazz);
               // other type Collection, Map or Object[].
               if (type != null)
               {
                  switch (type)
                  {
View Full Code Here

    * @return Object.
    * @throws JsonException if type is unknown.
    */
   private Object createObjectKnownTypes(Class<?> clazz, JsonValue jsonValue) throws JsonException
   {
      Types t = JsonUtils.getType(clazz);
      switch (t)
      {
         case NULL :
            return null;
         case BOOLEAN :
View Full Code Here

         {
            // If requested object is JsonValue then stop processing here.
            return jsonValue;
         }

         Types jtype = JsonUtils.getType(type);
         if (jtype == Types.ARRAY_BOOLEAN || jtype == Types.ARRAY_BYTE || jtype == Types.ARRAY_SHORT
            || jtype == Types.ARRAY_INT || jtype == Types.ARRAY_LONG || jtype == Types.ARRAY_FLOAT
            || jtype == Types.ARRAY_DOUBLE || jtype == Types.ARRAY_CHAR || jtype == Types.ARRAY_STRING
            || jtype == Types.ARRAY_OBJECT)
         {
View Full Code Here

            jsonValue = (JsonValue)t;
         }
         else
         {
            JsonGeneratorImpl generator = new JsonGeneratorImpl();
            Types jtype = JsonUtils.getType(type);
            if (jtype == Types.ARRAY_BOOLEAN || jtype == Types.ARRAY_BYTE || jtype == Types.ARRAY_SHORT
               || jtype == Types.ARRAY_INT || jtype == Types.ARRAY_LONG || jtype == Types.ARRAY_FLOAT
               || jtype == Types.ARRAY_DOUBLE || jtype == Types.ARRAY_CHAR || jtype == Types.ARRAY_STRING
               || jtype == Types.ARRAY_OBJECT)
            {
View Full Code Here

   public JsonValue createJsonArray(Object array) throws JsonException
   {
      if (array == null)
         return new NullValue();

      Types t = JsonUtils.getType(array);
      JsonValue jsonArray = new ArrayValue();
      int length = Array.getLength(array);
      if (t == Types.ARRAY_BOOLEAN)
      {
         for (int i = 0; i < length; i++)
View Full Code Here

    * @throws JsonException if any errors occurs.
    */
   @SuppressWarnings("unchecked")
   private JsonValue createJsonValue(Object object) throws JsonException
   {
      Types t = JsonUtils.getType(object);
      switch (t)
      {
         case NULL :
            return new NullValue();
         case BOOLEAN :
View Full Code Here

    * @throws JsonException if any errors occurs.
    */
   @SuppressWarnings("unchecked")
   protected JsonValue createJsonValue(Object object) throws JsonException
   {
      Types t = JsonUtils.getType(object);
      switch (t)
      {
         case NULL :
            return new NullValue();
         case BOOLEAN :
View Full Code Here

            {
               method.invoke(object, new Object[]{createObjectKnownTypes(methodParameterClazz, childJsonValue)});
            }
            else
            {
               Types type = JsonUtils.getType(methodParameterClazz);
               // other type Collection, Map or Object[].
               if (type != null)
               {
                  switch (type)
                  {
View Full Code Here

    * @return Object.
    * @throws JsonException if type is unknown.
    */
   private Object createObjectKnownTypes(Class<?> clazz, JsonValue jsonValue) throws JsonException
   {
      Types t = JsonUtils.getType(clazz);
      switch (t)
      {
         case NULL :
            return null;
         case BOOLEAN :
View Full Code Here

TOP

Related Classes of org.exoplatform.ws.frameworks.json.impl.JsonUtils.Types

Copyright © 2018 www.massapicom. 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.