code: public String writeValueAsString(Object obj, boolean indent) {
  		try {
  			if (indent) {
  				return this.mapper.writer().withDefaultPrettyPrinter()
  						.writeValueAsString(obj);
  			}
  			return this.mapper.writeValueAsString(obj);
  		}
  		catch (Exception e) {
  			LogFactory.getLog(JsonHandler.class).info("serialize object to json", e);
  			return null;
  		}
  	}
docs: Converts an object into a JSON string. In case of an exceptions returns null and
  logs the exception.
  
  @param obj the source object
  @param indent if true JSON is written in a human readable format, if false JSON is
  written on one line
  @return obj JSON string, <code>null</code> if an exception occurred