Code example for JsonTreeWriter

   * @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();
      write(jsonWriter, value);
      return jsonWriter.get();
    } catch (IOException e) {
      throw new JsonIOException(e);
   * Reads one JSON value (an array, object, string, number, boolean or null) 
   * and converts it to a Java object. Returns the converted object. 
   * @return the converted Java object. May be null.