View Javadoc

1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one
3    * or more contributor license agreements.  See the NOTICE file
4    * distributed with this work for additional information
5    * regarding copyright ownership.  The ASF licenses this file
6    * to you under the Apache License, Version 2.0 (the
7    * "License"); you may not use this file except in compliance
8    * with the License.  You may obtain a copy of the License at
9    *
10   *   http://www.apache.org/licenses/LICENSE-2.0
11   *
12   * Unless required by applicable law or agreed to in writing,
13   * software distributed under the License is distributed on an
14   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15   * KIND, either express or implied.  See the License for the
16   * specific language governing permissions and limitations
17   * under the License.
18   */
19  
20  package org.apache.myfaces.tobago.context;
21  
22  import javax.faces.context.FacesContext;
23  import javax.faces.context.ExternalContext;
24  import javax.faces.context.ResponseStream;
25  import javax.faces.context.ResponseWriter;
26  import javax.faces.application.Application;
27  import javax.faces.application.FacesMessage;
28  import javax.faces.render.RenderKit;
29  import javax.faces.component.UIViewRoot;
30  import java.util.Iterator;
31  
32  public class FacesContextWrapper extends javax.faces.context.FacesContext {
33    private FacesContext context;
34  
35    public FacesContextWrapper(FacesContext context) {
36      this.context = context;
37    }
38  
39    public final FacesContext getContext() {
40      return context;
41    }
42  
43    public Application getApplication() {
44      return context.getApplication();
45    }
46  
47    public Iterator getClientIdsWithMessages() {
48      return context.getClientIdsWithMessages();
49    }
50  
51    public ExternalContext getExternalContext() {
52      return context.getExternalContext();
53    }
54  
55    public FacesMessage.Severity getMaximumSeverity() {
56      return context.getMaximumSeverity();
57    }
58  
59    public Iterator getMessages() {
60      return context.getMessages();
61    }
62  
63    public Iterator getMessages(String clientId) {
64      return context.getMessages(clientId);
65    }
66  
67    public RenderKit getRenderKit() {
68      return context.getRenderKit();
69    }
70  
71    public boolean getRenderResponse() {
72      return context.getRenderResponse();
73    }
74  
75    public boolean getResponseComplete() {
76      return context.getResponseComplete();
77    }
78  
79    public ResponseStream getResponseStream() {
80      return context.getResponseStream();
81    }
82  
83    public void setResponseStream(ResponseStream responseStream) {
84      context.setResponseStream(responseStream);
85    }
86  
87    public ResponseWriter getResponseWriter() {
88      return context.getResponseWriter();
89    }
90  
91    public void setResponseWriter(ResponseWriter responseWriter) {
92      context.setResponseWriter(responseWriter);
93    }
94  
95    public UIViewRoot getViewRoot() {
96      return context.getViewRoot();
97    }
98  
99    public void setViewRoot(UIViewRoot root) {
100     context.setViewRoot(root);
101   }
102 
103   public void addMessage(String clientId, FacesMessage message) {
104     context.addMessage(clientId, message);
105   }
106 
107   public void release() {
108     context.release();
109   }
110 
111   public void renderResponse() {
112     context.renderResponse();
113   }
114 
115   public void responseComplete() {
116     context.responseComplete();
117   }
118 }