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