Code example for Writer

Methods: flush

0
	public <T> void marshal(T payload, Writer writer, RestClient client) throws IOException {
		if(payload.getClass().equals(String.class)) {
			writer.append(String.class.cast(payload));
			return; 
		} 
		xstream.toXML(payload, writer);
		writer.flush();
	} 
 
	public <T> T unmarshal(String content, RestClient client) {
		xstream.registerConverter(new DefaultLinkConverter(client));
		return (T) xstream.fromXML(content);
	} 
 
	protected List<Class> getTypesToEnhance() {
		return Collections.emptyList();
	} 
	protected List<String> getCollectionNames() {
		return Collections.emptyList();
	}