Package org.codehaus.jettison.json

Examples of org.codehaus.jettison.json.JSONException


            ResultItem<LastFMAlbum> item = new ResultItem<LastFMAlbum>(album, false, false);
            item.setImage(getImage(album));
            item.setType(album.getClass().getSimpleName());
            return item;
        } catch (UnsupportedEncodingException e) {
            throw new JSONException(e);
        }
    }
View Full Code Here


            item.setImage(getImage(artist));
            item.setType(artist.getClass().getSimpleName());
            return item;
        } catch (UnsupportedEncodingException e) {
            e.printStackTrace();
            throw new JSONException(e);
        }
    }
View Full Code Here

            ResultItem<LastFMTrack> item = new ResultItem<LastFMTrack>(track, false, false);
            item.setImage(getImage(track));
            item.setType(track.getClass().getSimpleName());
            return item;
        } catch (UnsupportedEncodingException e) {
            throw new JSONException(e);
        }
    }
View Full Code Here

            }
            back();

            String s = sb.toString().trim();
            if (s.length() == 0) {
                throw new JSONException("Missing value.");
            }
            Object res = null;
            if (s.equalsIgnoreCase("true")) {
                res = Boolean.TRUE;
            } else if (s.equalsIgnoreCase("false")) {
View Full Code Here

                    x.back();
                    break;
                case '}':
                    return;
                default:
                    throw new JSONException("Expected a ',' or '}'");
                }
            }
        }
View Full Code Here

    if (ROLE_TYPE.equalsIgnoreCase(type)) {
      visibilityType = Visibility.Type.ROLE;
    } else if (GROUP_TYPE.equalsIgnoreCase(type)) {
      visibilityType = Visibility.Type.GROUP;
    } else {
      throw new JSONException("[" + type + "] does not represent a valid visibility type. Expected ["
          + ROLE_TYPE + "] or [" + GROUP_TYPE + "].");
    }
    final String value = json.getString("value");
    return new Visibility(visibilityType, value);
  }
View Full Code Here

   
    final Iterator iterator = jsonObject.keys();
    while (iterator.hasNext()) {
      final Object o = iterator.next();
      if (!(o instanceof String)) {
        throw new JSONException("Cannot parse URIs: key is expected to be valid String. Got " + (o == null ? "null" : o.getClass()) + " instead.");
      }
      final String key = (String) o;
      uris.put(key, JsonParseUtil.parseURI(jsonObject.getString(key)));
    }
    return uris;
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

    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.