Examples of JsonParser


Examples of com.google.gson.JsonParser

    @SuppressWarnings("unchecked")
    private static Map<String, Object> decode (String s) {
        try {
            Map<String, Object> ret;
            JsonObject jso = new JsonParser().parse(s).getAsJsonObject();
            ret = (Map<String, Object>) decodeElement(jso);
            return ret;
        } catch (Exception e) {
            Logger.logError("Error decoding Authlib JSON", e);
            return null;
View Full Code Here

Examples of com.google.gson.JsonParser

        }

        InputStream input = entity.getContent();
        try {
            Reader reader = new BufferedReader(new InputStreamReader(input, ENCODING));
            JsonParser parser = new JsonParser();
            JsonElement element = parser.parse(reader);
            if ((element instanceof JsonObject) == false) {
                throw new IOException(MessageFormat.format(
                        "Response message was not a valid json object: {0} ({1})",
                        request.getURI(),
                        response.getStatusLine()));
View Full Code Here

Examples of com.google.gson.JsonParser

        }
        assertThat(handler.requestElement, is(nullValue()));
    }

    static JsonElement parse(String content) {
        return new JsonParser().parse(content);
    }
View Full Code Here

Examples of com.google.gson.JsonParser

      if (input.getName() != null) {
         jsonTag.addProperty("name", input.getName());
      }

      if (input.getMeta() != null) {
         jsonTag.add("meta", new JsonParser().parse(new Gson().toJson(input.getMeta())));
      }

      if (input.getResources() != null && input.getResources().size() != 0) {
         JsonArray uuidsArray = new JsonArray();
View Full Code Here

Examples of com.massivecraft.mcore.xlib.gson.JsonParser

    Long mtime = file.lastModified();
    if (mtime == 0) return null;
    String content = DiscUtil.readCatch(file);
    if (content == null) return null;
    if (content.length() == 0) return null;
    JsonElement raw = new JsonParser().parse(content);
    return new SimpleEntry<JsonElement, Long>(raw, mtime);
  }
View Full Code Here

Examples of com.newrelic.org.json.simple.parser.JSONParser

    long begin = System.currentTimeMillis();
    operations.getAndIncrement();
    try {
      if (debug)
        System.out.println(msg.toString());
      JSONObject json = (JSONObject)new JSONParser().parse(msg.toString());
             
      JSONObject timespent = (JSONObject) json.get("timespent");
      int calls = json.containsKey("calls") ? ((Long)json.get("calls")).intValue() : 1;
     
      if(timespent != null){
View Full Code Here

Examples of com.persiste.sdk.json.parser.JSONParser

   *   null
   *
   */
  public static Object parse(Reader in){
    try{
      JSONParser parser=new JSONParser();
      return parser.parse(in);
    }
    catch(Exception e){
      return null;
    }
  }
View Full Code Here

Examples of com.sdicons.json.parser.JSONParser

     *
     * @see de.netseeker.ejoe.adapter.SerializeAdapter#read(java.io.InputStream)
     */
    public Object read( InputStream in ) throws Exception
    {
        JSONParser parser = new JSONParser( in );
        JSONObject jObj = (JSONObject) parser.nextValue();
        Marshall marshaller = new JSONMarshall();
        return marshaller.unmarshall( jObj ).getReference();
    }
View Full Code Here

Examples of com.skaringa.json.parser.JsonParser

  public Object deserializeFromJson(InputStream stream, Class rootType)
      throws DeserializerException {

    try {
      Reader reader = new InputStreamReader(new BufferedInputStream(stream), "UTF-8");
      JsonParser parser = new JsonParser(reader, rootType, _properties, _classLoader);
      parser.process();
      return parser.getObject();
    } catch (IOException e) {
      Log.error(e);
      throw new DeserializerException(e.getMessage());
    }
  }
View Full Code Here

Examples of com.skaringa.json.parser.JsonParser

   */
  public Object deserializeFromJsonString(String s, Class rootType)
      throws DeserializerException {
    try {
      Reader reader = new StringReader(s);
      JsonParser parser = new JsonParser(reader, rootType, _properties, _classLoader);
      parser.process();
      return parser.getObject();
    } catch (IOException e) {
      Log.error(e);
      throw new DeserializerException(e.getMessage());
    }
  }
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.