Code example for Gson

Methods: toJson

0
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);
		} 
 
	}