001 /* 002 * Licensed to the Apache Software Foundation (ASF) under one 003 * or more contributor license agreements. See the NOTICE file 004 * distributed with this work for additional information 005 * regarding copyright ownership. The ASF licenses this file 006 * to you under the Apache License, Version 2.0 (the 007 * "License"); you may not use this file except in compliance 008 * with the License. You may obtain a copy of the License at 009 * 010 * http://www.apache.org/licenses/LICENSE-2.0 011 * 012 * Unless required by applicable law or agreed to in writing, 013 * software distributed under the License is distributed on an 014 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 015 * KIND, either express or implied. See the License for the 016 * specific language governing permissions and limitations 017 * under the License. 018 */ 019 020 package org.apache.myfaces.tobago.webapp; 021 022 import org.apache.myfaces.tobago.renderkit.html.HtmlAttributes; 023 import static org.apache.myfaces.tobago.TobagoConstants.ATTR_STYLE_CLASS; 024 import static org.apache.myfaces.tobago.TobagoConstants.ATTR_STYLE; 025 026 import javax.faces.component.UIComponent; 027 import javax.faces.context.ResponseWriter; 028 import java.io.IOException; 029 import java.io.Writer; 030 031 /* 032 * Date: May 12, 2007 033 * Time: 8:20:51 PM 034 */ 035 public class TobagoResponseWriterWrapper extends TobagoResponseWriter { 036 private ResponseWriter responseWriter; 037 038 public TobagoResponseWriterWrapper(ResponseWriter responseWriter) { 039 this.responseWriter = responseWriter; 040 } 041 042 public void startElement(String name, UIComponent component) throws IOException { 043 responseWriter.startElement(name, component); 044 } 045 046 public void endElement(String name) throws IOException { 047 responseWriter.endElement(name); 048 } 049 050 public void write(String string) throws IOException { 051 responseWriter.write(string); 052 } 053 054 public void writeComment(Object comment) throws IOException { 055 responseWriter.writeComment(comment); 056 } 057 058 public ResponseWriter cloneWithWriter(Writer writer) { 059 return responseWriter.cloneWithWriter(writer); 060 } 061 062 @Deprecated 063 public void writeAttribute(String name, Object value, String property) throws IOException { 064 responseWriter.writeAttribute(name, value, property); 065 } 066 067 @Deprecated 068 public void writeText(Object text, String property) throws IOException { 069 responseWriter.writeText(text, property); 070 } 071 072 public void flush() throws IOException { 073 responseWriter.flush(); 074 } 075 076 public void writeAttribute(String name, String value, boolean escape) throws IOException { 077 responseWriter.writeAttribute(name, value, null); 078 } 079 080 public void writeClassAttribute() throws IOException { 081 responseWriter.writeAttribute(HtmlAttributes.CLASS, null, ATTR_STYLE_CLASS); 082 } 083 084 public void writeStyleAttribute() throws IOException { 085 responseWriter.writeAttribute(HtmlAttributes.STYLE, null, ATTR_STYLE); 086 } 087 088 public String getContentType() { 089 return responseWriter.getContentType(); 090 } 091 092 public String getCharacterEncoding() { 093 return responseWriter.getCharacterEncoding(); 094 } 095 096 public void startDocument() throws IOException { 097 responseWriter.startDocument(); 098 } 099 100 public void endDocument() throws IOException { 101 responseWriter.endDocument(); 102 } 103 104 public void writeURIAttribute(String name, Object value, String property) throws IOException { 105 responseWriter.writeURIAttribute(name, value, property); 106 } 107 108 public void writeText(char[] text, int off, int len) throws IOException { 109 responseWriter.writeText(text, off, len); 110 } 111 112 public void write(char[] chars, int i, int i1) throws IOException { 113 responseWriter.write(chars, i, i1); 114 } 115 116 public void close() throws IOException { 117 responseWriter.close(); 118 } 119 }