Examples of JSONException


Examples of org.apache.wink.json4j.JSONException

                                                    }
                                                }
                                            }
                                        } else {
                                            // Dunno?
                                            throw new JSONException("Unknown type: [" + vClazz.getName() + "]");
                                        }
                                    } else {
                                        try {
                                            m = clazz.getMethod(setter, null);
                                        } catch (NoSuchMethodException nmex){
                                            // Ignore, no setter.
                                        }
                                    }
                                    if (m != null) {
                                        m.invoke(obj, new Object[] { val });
                                    }
                                }
                            }
                        }
                    } else {
                        throw new JSONException("Could not locate class: [" + cName + "]");
                    }
                } catch (Exception ex) {
                    if (ex instanceof JSONException) {
                        throw (JSONException)ex;
                    } else {
                        JSONException jex = new JSONException("Error in converting JSON to Java Class");
                        jex.initCause(ex);
                        throw jex;
                    }
                }
            } else {
                throw new JSONException("Provided JSONObject does not contain attributes '_classname' or '_type'");
            }
        }
        return obj;
    }
View Full Code Here

Examples of org.apache.wink.json4j.compat.JSONException

    public JSONArray createJSONArray(Collection collection) throws JSONException {
        try {
            org.apache.wink.json4j.JSONArray jArray = new org.apache.wink.json4j.JSONArray(collection);
            return new org.apache.wink.json4j.compat.impl.ApacheJSONArrayDelegate(jArray);
        } catch (Exception ex) {
            JSONException jex = new JSONException(ex.getMessage());
            jex.initCause(ex);
            throw jex;
        }
    }
View Full Code Here

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

Examples of org.codehaus.jettison.json.JSONException

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

Examples of org.codehaus.jettison.json.JSONException

            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

Examples of org.json.JSONException

          Long key = Long.valueOf(k);
          genericMap.put(key, obj2.getJSONObject(key.toString()));
        }
      } catch (Exception ex) {
        LOG.error("Got exception while parsing filterConfig", ex);
        throw new JSONException(ex);
      }

      Iterator<Entry<Long, JSONObject>> itr = genericMap.entrySet().iterator();

      while ( itr.hasNext())
View Full Code Here

Examples of org.json.JSONException

      if (JSONzip.probe) {
        JSONzip.logchar(symbol.integer, this.width);
      }
      return symbol.integer;
    } catch (final Throwable e) {
      throw new JSONException(e);
    }
  }
View Full Code Here

Examples of org.json.JSONException

        } else {
          bitwriter.one();
        }
      }
    } catch (final Throwable e) {
      throw new JSONException(e);
    }
  }
View Full Code Here

Examples of org.json.JSONException

      if (probe) {
        log(value ? 1 : 0);
      }
      return value;
    } catch (final Throwable e) {
      throw new JSONException(e);
    }

  }
View Full Code Here

Examples of org.json.JSONException

      if (JSONzip.probe) {
        JSONzip.log("\"" + value + "\"");
        JSONzip.log(integer, width);
      }
      if (integer >= keep.length) {
        throw new JSONException("Deep error.");
      }
      keep.tick(integer);
      return value;
    } catch (final Throwable e) {
      throw new JSONException(e);
    }
  }
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.