Coverage Report - org.apache.tiles.request.DispatchRequestWrapper
 
Classes in this File Line Coverage Branch Coverage Complexity
DispatchRequestWrapper
100%
25/25
N/A
1
 
 1  
 /*
 2  
  * $Id: DispatchRequestWrapper.java 1375743 2012-08-21 20:05:58Z nlebas $
 3  
  *
 4  
  * Licensed to the Apache Software Foundation (ASF) under one
 5  
  * or more contributor license agreements.  See the NOTICE file
 6  
  * distributed with this work for additional information
 7  
  * regarding copyright ownership.  The ASF licenses this file
 8  
  * to you under the Apache License, Version 2.0 (the
 9  
  * "License"); you may not use this file except in compliance
 10  
  * with the License.  You may obtain a copy of the License at
 11  
  *
 12  
  * http://www.apache.org/licenses/LICENSE-2.0
 13  
  *
 14  
  * Unless required by applicable law or agreed to in writing,
 15  
  * software distributed under the License is distributed on an
 16  
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 17  
  * KIND, either express or implied.  See the License for the
 18  
  * specific language governing permissions and limitations
 19  
  * under the License.
 20  
  */
 21  
 package org.apache.tiles.request;
 22  
 
 23  
 import java.io.IOException;
 24  
 import java.io.OutputStream;
 25  
 import java.io.PrintWriter;
 26  
 import java.io.Writer;
 27  
 import java.util.Collections;
 28  
 import java.util.List;
 29  
 import java.util.Locale;
 30  
 import java.util.Map;
 31  
 
 32  
 import org.apache.tiles.request.attribute.Addable;
 33  
 
 34  
 /**
 35  
  * Delegate for ease of customization.
 36  
  *
 37  
  * @deprecated prefer RequestWrapper which is more general in purpose, unless you want to override dispatch() or include().
 38  
  * @version $Rev: 1215009 $ $Date: 2011-12-16 01:32:31 +0100 (Fri, 16 Dec 2011) $
 39  
  */
 40  1
 @Deprecated
 41  
 public class DispatchRequestWrapper extends AbstractRequest implements
 42  
         RequestWrapper {
 43  
 
 44  
     /**
 45  
      * The wrapper request context object.
 46  
      */
 47  
     private DispatchRequest context;
 48  
 
 49  
     /**
 50  
      * Constructor.
 51  
      *
 52  
      * @param context The request context to wrap.
 53  
      */
 54  21
     public DispatchRequestWrapper(DispatchRequest context) {
 55  21
         this.context = context;
 56  21
     }
 57  
 
 58  
     /** {@inheritDoc} */
 59  
     public DispatchRequest getWrappedRequest() {
 60  4
         return context;
 61  
     }
 62  
 
 63  
     /** {@inheritDoc} */
 64  
     public Map<String, String> getHeader() {
 65  1
         return context.getHeader();
 66  
     }
 67  
 
 68  
     /** {@inheritDoc} */
 69  
     public Map<String, String[]> getHeaderValues() {
 70  1
         return context.getHeaderValues();
 71  
     }
 72  
 
 73  
     /** {@inheritDoc} */
 74  
     public Addable<String> getResponseHeaders() {
 75  1
         return context.getResponseHeaders();
 76  
     }
 77  
 
 78  
     /** {@inheritDoc} */
 79  
     public Map<String, Object> getContext(String scope) {
 80  5
         return context.getContext(scope);
 81  
     }
 82  
 
 83  
     /** {@inheritDoc} */
 84  
     public List<String> getAvailableScopes() {
 85  1
         return context.getAvailableScopes();
 86  
     }
 87  
 
 88  
     /** {@inheritDoc} */
 89  
     public ApplicationContext getApplicationContext() {
 90  1
         return context.getApplicationContext();
 91  
     }
 92  
 
 93  
     /** {@inheritDoc} */
 94  
     public void dispatch(String path) throws IOException {
 95  1
         context.dispatch(path);
 96  1
     }
 97  
 
 98  
     /** {@inheritDoc} */
 99  
     public void include(String path) throws IOException {
 100  1
         context.include(path);
 101  1
     }
 102  
 
 103  
     /** {@inheritDoc} */
 104  
     public OutputStream getOutputStream() throws IOException {
 105  1
         return context.getOutputStream();
 106  
     }
 107  
 
 108  
     /** {@inheritDoc} */
 109  
     public Writer getWriter() throws IOException {
 110  1
         return context.getWriter();
 111  
     }
 112  
 
 113  
     /** {@inheritDoc} */
 114  
     public PrintWriter getPrintWriter() throws IOException {
 115  1
         return context.getPrintWriter();
 116  
     }
 117  
 
 118  
     /** {@inheritDoc} */
 119  
     public boolean isResponseCommitted() {
 120  1
         return context.isResponseCommitted();
 121  
     }
 122  
 
 123  
     /** {@inheritDoc} */
 124  
     public void setContentType(String contentType) {
 125  1
         context.setContentType(contentType);
 126  1
     }
 127  
 
 128  
     /** {@inheritDoc} */
 129  
     public Map<String, String> getParam() {
 130  1
         return context.getParam();
 131  
     }
 132  
 
 133  
     /** {@inheritDoc} */
 134  
     public Map<String, String[]> getParamValues() {
 135  1
         return context.getParamValues();
 136  
     }
 137  
 
 138  
     /** {@inheritDoc} */
 139  
     public Locale getRequestLocale() {
 140  1
         return context.getRequestLocale();
 141  
     }
 142  
 
 143  
     /** {@inheritDoc} */
 144  
     public boolean isUserInRole(String role) {
 145  1
         return context.isUserInRole(role);
 146  
     }
 147  
 }