@Override
protected ReflectiveXMLFormat createXMLFormat(Request request,Response response) {
return new ReflectiveXMLFormat() {
@Override
protected void write(Object data, OutputStream output) throws IOException {
XStreamPersister p = xpf.createXMLPersister();
p.setCatalog( catalog );
p.setReferenceByName(true);
p.setExcludeIds();
configurePersister(p,this);
p.save( data, output );
}
@Override
protected Object read(InputStream in)
throws IOException {
XStreamPersister p = xpf.createXMLPersister();
p.setCatalog( catalog );
configurePersister(p,this);
return p.load( in, clazz );
}
};
}