001: /*
002: * Copyright 2004 The Apache Software Foundation.
003: *
004: * Licensed under the Apache License, Version 2.0 (the "License");
005: * you may not use this file except in compliance with the License.
006: * You may obtain a copy of the License at
007: *
008: * http://www.apache.org/licenses/LICENSE-2.0
009: *
010: * Unless required by applicable law or agreed to in writing, software
011: * distributed under the License is distributed on an "AS IS" BASIS,
012: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013: * See the License for the specific language governing permissions and
014: * limitations under the License.
015: */
016: package org.apache.myfaces.context;
017:
018: import javax.el.ELContext;
019: import javax.faces.application.Application;
020: import javax.faces.application.FacesMessage;
021: import javax.faces.application.FacesMessage.Severity;
022: import javax.faces.component.UIViewRoot;
023: import javax.faces.context.ExternalContext;
024: import javax.faces.context.FacesContext;
025: import javax.faces.context.ResponseStream;
026: import javax.faces.context.ResponseWriter;
027: import javax.faces.render.RenderKit;
028: import java.util.Iterator;
029:
030: /**
031: * Convenient class to wrap the current FacesContext.
032: * @author Manfred Geiler (latest modification by $Author: ssilvert $)
033: * @author Anton Koinov
034: * @version $Revision: 410018 $ $Date: 2006-05-29 05:59:46 +0200 (Mo, 29 Mai 2006) $
035: */
036: public class FacesContextWrapper extends FacesContext {
037: //~ Instance fields ----------------------------------------------------------------------------
038:
039: private FacesContext _facesContext;
040:
041: //~ Constructors -------------------------------------------------------------------------------
042:
043: public FacesContextWrapper(FacesContext facesContext) {
044: _facesContext = facesContext;
045: }
046:
047: //~ Methods ------------------------------------------------------------------------------------
048:
049: public Application getApplication() {
050: return _facesContext.getApplication();
051: }
052:
053: public Iterator getClientIdsWithMessages() {
054: return _facesContext.getClientIdsWithMessages();
055: }
056:
057: public ExternalContext getExternalContext() {
058: return _facesContext.getExternalContext();
059: }
060:
061: public Severity getMaximumSeverity() {
062: return _facesContext.getMaximumSeverity();
063: }
064:
065: public Iterator getMessages() {
066: return _facesContext.getMessages();
067: }
068:
069: public Iterator getMessages(String clientId) {
070: return _facesContext.getMessages(clientId);
071: }
072:
073: public RenderKit getRenderKit() {
074: return _facesContext.getRenderKit();
075: }
076:
077: public boolean getRenderResponse() {
078: return _facesContext.getRenderResponse();
079: }
080:
081: public boolean getResponseComplete() {
082: return _facesContext.getResponseComplete();
083: }
084:
085: public void setResponseStream(ResponseStream responsestream) {
086: _facesContext.setResponseStream(responsestream);
087: }
088:
089: public ResponseStream getResponseStream() {
090: return _facesContext.getResponseStream();
091: }
092:
093: public void setResponseWriter(ResponseWriter responsewriter) {
094: _facesContext.setResponseWriter(responsewriter);
095: }
096:
097: public ResponseWriter getResponseWriter() {
098: return _facesContext.getResponseWriter();
099: }
100:
101: public void setViewRoot(UIViewRoot viewRoot) {
102: _facesContext.setViewRoot(viewRoot);
103: }
104:
105: public UIViewRoot getViewRoot() {
106: return _facesContext.getViewRoot();
107: }
108:
109: public void addMessage(String clientId, FacesMessage message) {
110: _facesContext.addMessage(clientId, message);
111: }
112:
113: public void release() {
114: _facesContext.release();
115: }
116:
117: public void renderResponse() {
118: _facesContext.renderResponse();
119: }
120:
121: public void responseComplete() {
122: _facesContext.responseComplete();
123: }
124:
125: public ELContext getELContext() {
126: return _facesContext.getELContext();
127: }
128: }
|