Package org.codehaus.jettison.json

Examples of org.codehaus.jettison.json.JSONException


      JSONObject node = nodes.getJSONObject(i);
      if (node.has("couchApiBase")) {
        try {
          nodeUrls.add(new URL(node.getString("couchApiBase")));
        } catch (MalformedURLException e) {
          throw new JSONException("Got bad couchApiBase URL from config");
        }
      }
    }
    return nodeUrls;
  }
View Full Code Here


      JSONObject node = nodes.getJSONObject(i);
      if (node.has("couchApiBase")) {
        try {
          nodeNames.add(new URL(node.getString("couchApiBase")));
        } catch (MalformedURLException e) {
          throw new JSONException("Got bad couchApiBase URL from config");
        }
      }
    }
    return nodeNames;
  }
View Full Code Here

    } else if (rawValue instanceof CharSequence) {
      return rawValue.toString();
    } else if (rawValue instanceof Number) {
      return rawValue;
    } else {
      throw new JSONException("Cannot generate value - unknown type for me: " + rawValue.getClass());
    }
  }
View Full Code Here

        try {
            return new JSONObject(new JSONTokener(mapper.writeValueAsString(objectNode)));
        } catch (IOException ioe) {
            // repackage this as a JSONException...seems sensible as the caller will only know about
            // the jettison object not being created
            throw new JSONException(ioe);
        }
    }
View Full Code Here

      JSONObject node = nodes.getJSONObject(i);
      if (node.has("couchApiBase")) {
        try {
          nodeUrls.add(new URL(node.getString("couchApiBase")));
        } catch (MalformedURLException e) {
          throw new JSONException("Got bad couchApiBase URL from config");
        }
      }
    }
    return nodeUrls;
  }
View Full Code Here

      type = "customFieldOption";
    }
    @SuppressWarnings("unchecked")
    final JsonParser<Object> jsonParser = registeredAllowedValueParsers.get(type);
    if (jsonParser == null) {
      throw new JSONException("Cannot find parser for field witch schema: " + fieldSchema);
    }
    else {
      return jsonParser;
    }
  }
View Full Code Here

    if ("OUTBOUND".equals(dirStr)) {
      direction = IssueLinkType.Direction.OUTBOUND;
    } else if ("INBOUND".equals(dirStr)) {
      direction = IssueLinkType.Direction.INBOUND;
    } else {
      throw new JSONException("Invalid value of " + KEY_DIRECTION + " key: [" + dirStr + "]");
    }
    return new IssueLinkType(name, description, direction);
  }
View Full Code Here

      return AssigneeType.PROJECT_LEAD;
    }
    if (AssigneeTypeConstants.UNASSIGNED.equals(str)) {
      return AssigneeType.UNASSIGNED;
    }
    throw new JSONException("Unexpected value of assignee type [" + str + "]");
  }
View Full Code Here

    if ("OUTBOUND".equals(dirStr)) {
      direction = IssueLinkType.Direction.OUTBOUND;
    } else if ("INBOUND".equals(dirStr)) {
      direction = IssueLinkType.Direction.INBOUND;
    } else {
      throw new JSONException("Invalid value of " + KEY_DIRECTION + " key: [" + dirStr + "]");
    }
    return new IssueLinkType(name, description, direction);
  }
View Full Code Here

      return AssigneeType.PROJECT_LEAD;
    }
    if (AssigneeTypeConstants.UNASSIGNED.equals(str)) {
      return AssigneeType.UNASSIGNED;
    }
    throw new JSONException("Unexpected value of assignee type [" + str + "]");
  }
View Full Code Here

TOP

Related Classes of org.codehaus.jettison.json.JSONException

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.