Просто создайте свой собственный ResponseWriterWrapper
класс.
public abstract class ResponseWriterWrapper extends ResponseWriter {
public abstract ResponseWriter getWrapped();
@Override
public String getContentType() {
return getWrapped().getContentType();
}
@Override
public String getCharacterEncoding() {
return getWrapped().getCharacterEncoding();
}
@Override
public void flush() throws IOException {
getWrapped().flush();
}
@Override
public void startDocument() throws IOException {
getWrapped().startDocument();
}
// Etc... Just override all abstract methods of ResponseWriter
// and delegate the call to getWrapped(). There are 15 of them.
}
По сути, это удобный класс, так что вам не нужно реализовывать все 15 абстрактных методов всякий раз, когда вам нужен только один или два из них.