Package com.massivecraft.mcore.xlib.gson.internal.bind

Examples of com.massivecraft.mcore.xlib.gson.internal.bind.JsonTreeWriter


  }

  // TODO: remove this when TypeAdapter.toJsonTree() is public
  private static <T> JsonElement toJsonTree(TypeAdapter<T> typeAdapter, T value) {
    try {
      JsonTreeWriter jsonWriter = new JsonTreeWriter();
      jsonWriter.setLenient(true);
      typeAdapter.write(jsonWriter, value);
      return jsonWriter.get();
    } catch (IOException e) {
      throw new JsonIOException(e);
    }
  }
View Full Code Here


   * </pre>
   * @return Json representation of {@code src}
   * @since 1.4
   */
  public JsonElement toJsonTree(Object src, Type typeOfSrc) {
    JsonTreeWriter writer = new JsonTreeWriter();
    toJson(src, typeOfSrc, writer);
    return writer.get();
  }
View Full Code Here

   * @param value the Java object to convert. May be null.
   * @return the converted JSON tree. May be {@link JsonNull}.
   */
  /*public*/ final JsonElement toJsonTree(T value) {
    try {
      JsonTreeWriter jsonWriter = new JsonTreeWriter();
      jsonWriter.setLenient(true);
      write(jsonWriter, value);
      return jsonWriter.get();
    } catch (IOException e) {
      throw new JsonIOException(e);
    }
  }
View Full Code Here

TOP

Related Classes of com.massivecraft.mcore.xlib.gson.internal.bind.JsonTreeWriter

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.