Coverage Report - org.seasar.teeda.core.context.ExternalContextWrapper
 
Classes in this File Line Coverage Branch Coverage Complexity
ExternalContextWrapper
12%
6/49
N/A
1
 
 1  
 /*
 2  
  * Copyright 2004-2011 the Seasar Foundation and the Others.
 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,
 13  
  * either express or implied. See the License for the specific language
 14  
  * governing permissions and limitations under the License.
 15  
  */
 16  
 package org.seasar.teeda.core.context;
 17  
 
 18  
 import java.io.IOException;
 19  
 import java.io.InputStream;
 20  
 import java.io.Serializable;
 21  
 import java.net.MalformedURLException;
 22  
 import java.net.URL;
 23  
 import java.security.Principal;
 24  
 import java.util.Iterator;
 25  
 import java.util.Locale;
 26  
 import java.util.Map;
 27  
 import java.util.Set;
 28  
 
 29  
 import javax.faces.context.ExternalContext;
 30  
 import javax.portlet.PortletContext;
 31  
 import javax.portlet.PortletRequest;
 32  
 import javax.portlet.PortletResponse;
 33  
 import javax.servlet.ServletContext;
 34  
 import javax.servlet.ServletRequest;
 35  
 import javax.servlet.ServletResponse;
 36  
 
 37  
 import org.seasar.teeda.core.context.portlet.PortletExternalContextImpl;
 38  
 import org.seasar.teeda.core.context.servlet.ServletExternalContextImpl;
 39  
 
 40  
 /**
 41  
  * @author shot
 42  
  * @author shinsuke
 43  
  */
 44  
 public class ExternalContextWrapper extends ExternalContext implements
 45  
         Serializable {
 46  
 
 47  
     private static final long serialVersionUID = 1L;
 48  
 
 49  
     private ExternalContext externalContext;
 50  
 
 51  1
     public ExternalContextWrapper() {
 52  1
     }
 53  
 
 54  0
     public ExternalContextWrapper(ExternalContext externalContext) {
 55  0
         this.externalContext = externalContext;
 56  0
     }
 57  
 
 58  
     public ExternalContextWrapper(ServletContext context,
 59  
             ServletRequest request, ServletResponse response) {
 60  0
         this(new ServletExternalContextImpl(context, request, response));
 61  0
     }
 62  
 
 63  
     public ExternalContextWrapper(PortletContext context,
 64  
             PortletRequest request, PortletResponse response) {
 65  0
         this(new PortletExternalContextImpl(context, request, response));
 66  0
     }
 67  
 
 68  
     public void dispatch(String path) throws IOException {
 69  1
         externalContext.dispatch(path);
 70  1
     }
 71  
 
 72  
     public String encodeActionURL(String url) {
 73  0
         return externalContext.encodeActionURL(url);
 74  
     }
 75  
 
 76  
     public String encodeNamespace(String name) {
 77  0
         return externalContext.encodeNamespace(name);
 78  
     }
 79  
 
 80  
     public String encodeResourceURL(String url) {
 81  0
         return externalContext.encodeResourceURL(url);
 82  
     }
 83  
 
 84  
     public Map getApplicationMap() {
 85  0
         return externalContext.getApplicationMap();
 86  
     }
 87  
 
 88  
     public String getAuthType() {
 89  0
         return externalContext.getAuthType();
 90  
     }
 91  
 
 92  
     public Object getContext() {
 93  0
         return externalContext.getContext();
 94  
     }
 95  
 
 96  
     public String getInitParameter(String name) {
 97  0
         return externalContext.getInitParameter(name);
 98  
     }
 99  
 
 100  
     public Map getInitParameterMap() {
 101  0
         return externalContext.getInitParameterMap();
 102  
     }
 103  
 
 104  
     public String getRemoteUser() {
 105  0
         return externalContext.getRemoteUser();
 106  
     }
 107  
 
 108  
     public Object getRequest() {
 109  0
         return externalContext.getRequest();
 110  
     }
 111  
 
 112  
     public String getRequestContextPath() {
 113  0
         return externalContext.getRequestContextPath();
 114  
     }
 115  
 
 116  
     public Map getRequestCookieMap() {
 117  0
         return externalContext.getRequestCookieMap();
 118  
     }
 119  
 
 120  
     public Map getRequestHeaderMap() {
 121  0
         return externalContext.getRequestHeaderMap();
 122  
     }
 123  
 
 124  
     public Map getRequestHeaderValuesMap() {
 125  0
         return externalContext.getRequestHeaderValuesMap();
 126  
     }
 127  
 
 128  
     public Locale getRequestLocale() {
 129  0
         return externalContext.getRequestLocale();
 130  
     }
 131  
 
 132  
     public Iterator getRequestLocales() {
 133  0
         return externalContext.getRequestLocales();
 134  
     }
 135  
 
 136  
     public Map getRequestMap() {
 137  0
         return externalContext.getRequestMap();
 138  
     }
 139  
 
 140  
     public Map getRequestParameterMap() {
 141  0
         return externalContext.getRequestParameterMap();
 142  
     }
 143  
 
 144  
     public Iterator getRequestParameterNames() {
 145  0
         return externalContext.getRequestParameterNames();
 146  
     }
 147  
 
 148  
     public Map getRequestParameterValuesMap() {
 149  0
         return externalContext.getRequestParameterValuesMap();
 150  
     }
 151  
 
 152  
     public String getRequestPathInfo() {
 153  0
         return externalContext.getRequestPathInfo();
 154  
     }
 155  
 
 156  
     public String getRequestServletPath() {
 157  0
         return externalContext.getRequestServletPath();
 158  
     }
 159  
 
 160  
     public URL getResource(String path) throws MalformedURLException {
 161  0
         return externalContext.getResource(path);
 162  
     }
 163  
 
 164  
     public InputStream getResourceAsStream(String path) {
 165  0
         return externalContext.getResourceAsStream(path);
 166  
     }
 167  
 
 168  
     public Set getResourcePaths(String path) {
 169  0
         return externalContext.getResourcePaths(path);
 170  
     }
 171  
 
 172  
     public Object getResponse() {
 173  0
         return externalContext.getResponse();
 174  
     }
 175  
 
 176  
     public Object getSession(boolean create) {
 177  0
         return externalContext.getSession(create);
 178  
     }
 179  
 
 180  
     public Map getSessionMap() {
 181  0
         return externalContext.getSessionMap();
 182  
     }
 183  
 
 184  
     public Principal getUserPrincipal() {
 185  0
         return externalContext.getUserPrincipal();
 186  
     }
 187  
 
 188  
     public boolean isUserInRole(String role) {
 189  0
         return externalContext.isUserInRole(role);
 190  
     }
 191  
 
 192  
     public void log(String message) {
 193  0
         externalContext.log(message);
 194  0
     }
 195  
 
 196  
     public void log(String message, Throwable exception) {
 197  0
         externalContext.log(message, exception);
 198  0
     }
 199  
 
 200  
     public void redirect(String url) throws IOException {
 201  0
         externalContext.redirect(url);
 202  0
     }
 203  
 
 204  
     public void setExternalContext(ExternalContext externalContext) {
 205  1
         this.externalContext = externalContext;
 206  1
     }
 207  
 }