Code example for Gson

Methods: toJson

0
					writer.append("{} && ");
				} 
 
				if (typeOfSrc != null)
				{ 
					this.gson.toJson(o, typeOfSrc, writer);
				} 
				else 
				{ 
					this.gson.toJson(o, writer);
				} 
			} 
		} 
		catch (JsonIOException ex)
		{ 
			throw new HttpMessageNotWritableException("Could not write JSON: " + ex.getMessage(), ex);
		} 
		finally 
		{ 
			IOUtils.closeQuietly(writer);