Examples of JsonAccessor


Examples of com.cloud.bridge.util.JsonAccessor

  public <T> List<T> listCall(CloudStackCommand cmd, String apiKey, String secretKey,
    String responseName, String responseObjName, Type collectionType) throws Exception {
   
    assert(responseName != null);
   
    JsonAccessor json = execute(cmd, apiKey, secretKey);
   
   

    if(responseObjName != null)
      try {
        return (new Gson()).fromJson(json.eval(responseName + "." + responseObjName), collectionType);
      } catch(Exception e) {
        // this happens because responseObjName won't exist if there are no objects in the list.
                                logger.debug("CloudSatck API response doesn't contain responseObjName:" + responseObjName +
                                        " because response is empty");
        return null;
      }
    return (new Gson()).fromJson(json.eval(responseName), collectionType);
  }
View Full Code Here

Examples of com.cloud.bridge.util.JsonAccessor

          throw new IOException("CloudStack API call error : invalid JSON response");
    }
   
    if(logger.isDebugEnabled())
      logger.debug("Cloud API call + [" + url.toString() + "] returned: " + jsonElement.toString());
    return new JsonAccessor(jsonElement);
  }
View Full Code Here

Examples of jsonij.json.annotation.JSONAccessor

        return name;
    }

    public static String getJSONAccessor(AccessibleObject object) {
        String name = null;
        JSONAccessor jsonAccessorAnnotation = object.getAnnotation(JSONAccessor.class);
        if (jsonAccessorAnnotation != null) {
            name = jsonAccessorAnnotation.value();
        }
        return name;
    }
View Full Code Here

Examples of jsonij.json.annotation.JSONAccessor

        return name;
    }

    public static String getJSONAccessor(AccessibleObject object) {
        String name = null;
        JSONAccessor jsonAccessorAnnotation = object.getAnnotation(JSONAccessor.class);
        if (jsonAccessorAnnotation != null) {
            name = jsonAccessorAnnotation.value();
        }
        return name;
    }
View Full Code Here

Examples of jsonij.json.marshal.annotation.JSONAccessor

        return name;
    }

    public static String getJSONAccessor(AccessibleObject object) {
        String name = null;
        JSONAccessor jsonAccessorAnnotation = object.getAnnotation(JSONAccessor.class);
        if (jsonAccessorAnnotation != null) {
            name = jsonAccessorAnnotation.value();
        }
        return name;
    }
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.