001 package org.apache.myfaces.tobago.context; 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 javax.faces.context.FacesContext; 021 import javax.faces.context.ExternalContext; 022 import javax.faces.context.ResponseStream; 023 import javax.faces.context.ResponseWriter; 024 import javax.faces.application.Application; 025 import javax.faces.application.FacesMessage; 026 import javax.faces.render.RenderKit; 027 import javax.faces.component.UIViewRoot; 028 import java.util.Iterator; 029 030 /* 031 * Date: Feb 28, 2007 032 * Time: 8:01:37 PM 033 */ 034 public class FacesContextWrapper extends javax.faces.context.FacesContext { 035 private FacesContext context; 036 037 public FacesContextWrapper(FacesContext context) { 038 this.context = context; 039 } 040 041 public final FacesContext getContext() { 042 return context; 043 } 044 045 public Application getApplication() { 046 return context.getApplication(); 047 } 048 049 public Iterator getClientIdsWithMessages() { 050 return context.getClientIdsWithMessages(); 051 } 052 053 public ExternalContext getExternalContext() { 054 return context.getExternalContext(); 055 } 056 057 public FacesMessage.Severity getMaximumSeverity() { 058 return context.getMaximumSeverity(); 059 } 060 061 public Iterator getMessages() { 062 return context.getMessages(); 063 } 064 065 public Iterator getMessages(String clientId) { 066 return context.getMessages(clientId); 067 } 068 069 public RenderKit getRenderKit() { 070 return context.getRenderKit(); 071 } 072 073 public boolean getRenderResponse() { 074 return context.getRenderResponse(); 075 } 076 077 public boolean getResponseComplete() { 078 return context.getResponseComplete(); 079 } 080 081 public ResponseStream getResponseStream() { 082 return context.getResponseStream(); 083 } 084 085 public void setResponseStream(ResponseStream responseStream) { 086 context.setResponseStream(responseStream); 087 } 088 089 public ResponseWriter getResponseWriter() { 090 return context.getResponseWriter(); 091 } 092 093 public void setResponseWriter(ResponseWriter responseWriter) { 094 context.setResponseWriter(responseWriter); 095 } 096 097 public UIViewRoot getViewRoot() { 098 return context.getViewRoot(); 099 } 100 101 public void setViewRoot(UIViewRoot root) { 102 context.setViewRoot(root); 103 } 104 105 public void addMessage(String clientId, FacesMessage message) { 106 context.addMessage(clientId, message); 107 } 108 109 public void release() { 110 context.release(); 111 } 112 113 public void renderResponse() { 114 context.renderResponse(); 115 } 116 117 public void responseComplete() { 118 context.responseComplete(); 119 } 120 }