Package org.codehaus.jettison.json

Examples of org.codehaus.jettison.json.JSONObject.names()


      errorMessages = Collections.emptyList();
    }

    final Map<String, String> errors;
    if (jsonErrors != null && jsonErrors.length() > 0) {
      errors = JsonParseUtil.toStringMap(jsonErrors.names(), jsonErrors);
    } else {
      errors = Collections.emptyMap();
    }
    return new ErrorCollection(status, errorMessages, errors);
  }
View Full Code Here


    private void extractUserDefinedTypes(JSONObject doc)
        throws JSONValidationException {
        if (doc.has(USER_TYPES)) {
            try {
                JSONObject types = doc.getJSONObject(USER_TYPES);
                JSONArray attributes = types.names();
                for (int i = 0; i < attributes.length(); i++) {
                    String name = attributes.getString(i);
                    Object oValue = types.get(name);
                    if (oValue instanceof JSONObject || oValue instanceof JSONArray) {
                        throw new JSONValidationException(
View Full Code Here

    private void extractUserDefinedTypes(JSONObject doc)
        throws JSONValidationException {
        if (doc.has(USER_TYPES)) {
            try {
                JSONObject types = doc.getJSONObject(USER_TYPES);
                JSONArray attributes = types.names();
                for (int i = 0; i < attributes.length(); i++) {
                    String name = attributes.getString(i);
                    Object oValue = types.get(name);
                    if (oValue instanceof JSONObject || oValue instanceof JSONArray) {
                        throw new JSONValidationException(
View Full Code Here

      errorMessages = Collections.emptyList();
    }

    final Map<String, String> errors;
    if (jsonErrors != null && jsonErrors.length() > 0) {
      errors = JsonParseUtil.toStringMap(jsonErrors.names(), jsonErrors);
    } else {
      errors = Collections.emptyMap();
    }
    return new ErrorCollection(status, errorMessages, errors);
  }
View Full Code Here

   */
  private Double getMessageRate(String requestURL) throws JSONException {
    String response = restTemplate.getForObject(requestURL, String.class).toString();
    JSONObject jObject = new JSONObject(response);
    JSONObject value = jObject.getJSONObject("value");
    return (Double) value.getJSONObject((String) value.names().get(0)).get("MeanSendRate");
  }

  /**
   * Shutdown container by the given containerId.
   *
 
View Full Code Here

    JsonLdResource subject = new JsonLdResource();

    try {
      if (jo.has(JsonLdCommon.CONTEXT)) {
        JSONObject context = jo.getJSONObject(JsonLdCommon.CONTEXT);
        for (int i = 0; i < context.names().length(); i++) {
          String name = context.names().getString(i).toLowerCase();
          if (name.equals(JsonLdCommon.COERCE)) {
            JSONObject typeObject = context.getJSONObject(name);
            for (int j = 0; j < typeObject.names().length(); j++) {
              String property = typeObject.names().getString(j);
View Full Code Here

    try {
      if (jo.has(JsonLdCommon.CONTEXT)) {
        JSONObject context = jo.getJSONObject(JsonLdCommon.CONTEXT);
        for (int i = 0; i < context.names().length(); i++) {
          String name = context.names().getString(i).toLowerCase();
          if (name.equals(JsonLdCommon.COERCE)) {
            JSONObject typeObject = context.getJSONObject(name);
            for (int j = 0; j < typeObject.names().length(); j++) {
              String property = typeObject.names().getString(j);
              String type = typeObject.getString(property);
View Full Code Here

        JSONObject context = jo.getJSONObject(JsonLdCommon.CONTEXT);
        for (int i = 0; i < context.names().length(); i++) {
          String name = context.names().getString(i).toLowerCase();
          if (name.equals(JsonLdCommon.COERCE)) {
            JSONObject typeObject = context.getJSONObject(name);
            for (int j = 0; j < typeObject.names().length(); j++) {
              String property = typeObject.names().getString(j);
              String type = typeObject.getString(property);
              subject.putPropertyType(property, type);
            }
          } else {
View Full Code Here

        for (int i = 0; i < context.names().length(); i++) {
          String name = context.names().getString(i).toLowerCase();
          if (name.equals(JsonLdCommon.COERCE)) {
            JSONObject typeObject = context.getJSONObject(name);
            for (int j = 0; j < typeObject.names().length(); j++) {
              String property = typeObject.names().getString(j);
              String type = typeObject.getString(property);
              subject.putPropertyType(property, type);
            }
          } else {
            jld.addNamespacePrefix(context.getString(name), name);
View Full Code Here

      errorMessages = Collections.emptyList();
    }

    final Map<String, String> errors;
    if (jsonErrors != null) {
      errors = JsonParseUtil.toStringMap(jsonErrors.names(), jsonErrors);
    } else {
      errors = Collections.emptyMap();
    }

    return new BulkOperationErrorResult(new ErrorCollection(status, errorMessages, errors), issueNumber);
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.