code: public synchronized String toJson(Object input)
              throws JsonException {
          try {
              //   depth = 0;
              return recurse(input);
          } catch (IOException e) {
              throw new JsonException(e);
          }
      }
docs: Converts a given object into a JSON String
  
  @param input the object to convert into json
  @return the JSON string corresponding to the given object.
  @throws JsonException If the object can not be converted to a JSON string.