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