Package com.google.gson

Examples of com.google.gson.JsonSyntaxException


                } catch (ParseException e2) {
                    try {
                        String tmp = value.replace("Z", "+00:00");
                        return iso8601Format.parse(tmp.substring(0, 22) + tmp.substring(23));
                    } catch (ParseException e3) {
                        throw new JsonSyntaxException("Invalid date: " + value, e3);
                    }
                }
            }
        }
    }
View Full Code Here


                    } else {
                        field.read(in, instance);
                    }
                }
            } catch (IllegalStateException e) {
                throw new JsonSyntaxException(e);
            } catch (IllegalAccessException e) {
                throw new AssertionError(e);
            }
            in.endObject();
            return instance;
View Full Code Here

        try {
            synchronized (useDateFormat) {
                return useDateFormat.parse(s);
            }
        } catch (ParseException e) {
            throw new JsonSyntaxException(s, e);
        }
    }
View Full Code Here

          } else {
            field.read(in, instance);
          }
        }
      } catch (IllegalStateException e) {
        throw new JsonSyntaxException(e);
      } catch (IllegalAccessException e) {
        throw new AssertionError(e);
      }
      in.endObject();
      return instance;
View Full Code Here

    try {
      if (obj != null && reader.peek() != JsonToken.END_DOCUMENT) {
        throw new JsonIOException("JSON document was not fully consumed.");
      }
    } catch (final MalformedJsonException e) {
      throw new JsonSyntaxException(e);
    } catch (final IOException e) {
      throw new JsonIOException(e);
    }
  }
View Full Code Here

    if (token != null) {
      try {
        adaptCurrentToken();
      } catch (final XmlPullParserException e) {
        throw new JsonSyntaxException("XML parsing exception", e);
      }
      expectedToken = null;
      return token;
    }

    try {

      fillQueues(false);
      expectedToken = null;

      return token = nextToken();

    } catch (final XmlPullParserException e) {
      throw new JsonSyntaxException("XML parsing exception", e);
    }
  }
View Full Code Here

      addToQueue(name);
      addTextToQueue(xml.value, false);
      return false;

    default:
      throw new JsonSyntaxException("Cannot process text '" + xml.value + "' inside scope " + scopeStack.peek());
    }
  }
View Full Code Here

            return score;
          }
        }
        return Score.not_reviewed;
      } catch (Exception e) {
        throw new JsonSyntaxException(jsonElement.getAsString(), e);
      }
    }
View Full Code Here

        synchronized (dateFormat) {
          Date date = dateFormat.parse(jsonElement.getAsString());
          return new Date((date.getTime() / 1000) * 1000);
        }
      } catch (ParseException e) {
        throw new JsonSyntaxException(jsonElement.getAsString(), e);
      }
    }
View Full Code Here

                } catch (ParseException e2) {
                    try {
                        String tmp = value.replace("Z", "+00:00");
                        return iso8601Format.parse(tmp.substring(0, 22) + tmp.substring(23));
                    } catch (ParseException e3) {
                        throw new JsonSyntaxException("Invalid date " + value, e3);
                    }
                }
            }
        }
    }
View Full Code Here

TOP

Related Classes of com.google.gson.JsonSyntaxException

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.