Code example for StringWriter

Methods: toString, write

0
	} 
	 
	@Override 
	public String toJpdl() {
		 
		StringWriter jpdl = new StringWriter();
		jpdl.write("<property");
		jpdl.write(JsonToJpdl.transformAttribute("name", name));
		jpdl.write(JsonToJpdl.transformAttribute("value", value));
		jpdl.write(" />");
		 
		return jpdl.toString();
	} 
	 
	@Override 
	public JSONObject toJson() throws JSONException {
		JSONObject property = new JSONObject();
		if (name != null)
			property.put("name", name);
		if (value != null)
			property.put("value", value);