//JD: we create custom formats here because we need to set up the collection aliases
// correctly, basically whatever collection we get back we ant to alias to layers, featureTypes,
// coverages, styles, etc...
@Override
protected ReflectiveJSONFormat createJSONFormat(Request request, Response response) {
final ReflectiveJSONFormat f = super.createJSONFormat(request, response);
return new ReflectiveJSONFormat() {
@Override
public XStream getXStream() {
return f.getXStream();
}
@Override
protected void write(Object data, OutputStream output) throws IOException {
aliasCollection(data, f.getXStream());
f.getXStream().toXML(data, output);
}
};
}