KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > myfaces > context > FacesContextWrapper


1 /*
2  * Copyright 2004 The Apache Software Foundation.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16 package org.apache.myfaces.context;
17
18 import javax.faces.application.Application;
19 import javax.faces.application.FacesMessage;
20 import javax.faces.application.FacesMessage.Severity;
21 import javax.faces.component.UIViewRoot;
22 import javax.faces.context.ExternalContext;
23 import javax.faces.context.FacesContext;
24 import javax.faces.context.ResponseStream;
25 import javax.faces.context.ResponseWriter;
26 import javax.faces.render.RenderKit;
27 import java.util.Iterator JavaDoc;
28
29
30 /**
31  * Convenient class to wrap the current FacesContext.
32  * @author Manfred Geiler (latest modification by $Author: matze $)
33  * @author Anton Koinov
34  * @version $Revision: 1.11 $ $Date: 2004/10/13 11:51:00 $
35  */

36 public class FacesContextWrapper
37     extends FacesContext
38 {
39     //~ Instance fields ----------------------------------------------------------------------------
40

41     private FacesContext _facesContext;
42
43     //~ Constructors -------------------------------------------------------------------------------
44

45     public FacesContextWrapper(FacesContext facesContext)
46     {
47         _facesContext = facesContext;
48     }
49
50     //~ Methods ------------------------------------------------------------------------------------
51

52     public Application getApplication()
53     {
54         return _facesContext.getApplication();
55     }
56
57     public Iterator JavaDoc getClientIdsWithMessages()
58     {
59         return _facesContext.getClientIdsWithMessages();
60     }
61
62     public ExternalContext getExternalContext()
63     {
64         return _facesContext.getExternalContext();
65     }
66
67     public Severity getMaximumSeverity()
68     {
69         return _facesContext.getMaximumSeverity();
70     }
71
72     public Iterator JavaDoc getMessages()
73     {
74         return _facesContext.getMessages();
75     }
76
77     public Iterator JavaDoc getMessages(String JavaDoc clientId)
78     {
79         return _facesContext.getMessages(clientId);
80     }
81
82     public RenderKit getRenderKit()
83     {
84         return _facesContext.getRenderKit();
85     }
86
87     public boolean getRenderResponse()
88     {
89         return _facesContext.getRenderResponse();
90     }
91
92     public boolean getResponseComplete()
93     {
94         return _facesContext.getResponseComplete();
95     }
96
97     public void setResponseStream(ResponseStream responsestream)
98     {
99         _facesContext.setResponseStream(responsestream);
100     }
101
102     public ResponseStream getResponseStream()
103     {
104         return _facesContext.getResponseStream();
105     }
106
107     public void setResponseWriter(ResponseWriter responsewriter)
108     {
109         _facesContext.setResponseWriter(responsewriter);
110     }
111
112     public ResponseWriter getResponseWriter()
113     {
114         return _facesContext.getResponseWriter();
115     }
116
117     public void setViewRoot(UIViewRoot viewRoot)
118     {
119         _facesContext.setViewRoot(viewRoot);
120     }
121
122     public UIViewRoot getViewRoot()
123     {
124         return _facesContext.getViewRoot();
125     }
126
127     public void addMessage(String JavaDoc clientId, FacesMessage message)
128     {
129         _facesContext.addMessage(clientId, message);
130     }
131
132     public void release()
133     {
134         _facesContext.release();
135     }
136
137     public void renderResponse()
138     {
139         _facesContext.renderResponse();
140     }
141
142     public void responseComplete()
143     {
144         _facesContext.responseComplete();
145     }
146 }
147
Popular Tags