Coverage Report - org.apache.tapestry.request.DecodedRequest
 
Classes in this File Line Coverage Branch Coverage Complexity
DecodedRequest
0%
0/22
N/A
1
 
 1  
 // Copyright 2004, 2005 The Apache Software Foundation
 2  
 //
 3  
 // Licensed under the Apache License, Version 2.0 (the "License");
 4  
 // you may not use this file except in compliance with the License.
 5  
 // You may obtain a copy of the License at
 6  
 //
 7  
 //     http://www.apache.org/licenses/LICENSE-2.0
 8  
 //
 9  
 // Unless required by applicable law or agreed to in writing, software
 10  
 // distributed under the License is distributed on an "AS IS" BASIS,
 11  
 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 12  
 // See the License for the specific language governing permissions and
 13  
 // limitations under the License.
 14  
 
 15  
 package org.apache.tapestry.request;
 16  
 
 17  
 import javax.servlet.http.HttpServletRequest;
 18  
 
 19  
 /**
 20  
  * Contains properties of an {@link javax.servlet.http.HttpServletRequest}that have been extracted
 21  
  * from the request (or otherwise determined). An instance of this is created by an
 22  
  * {@link org.apache.tapestry.request.IRequestDecoder}. The decoder must set the serverName and
 23  
  * requestURI properties, and should set the scheme and server port properties.
 24  
  * 
 25  
  * @see IRequestDecoder
 26  
  * @author Howard Lewis Ship
 27  
  * @since 2.2
 28  
  */
 29  
 
 30  
 public class DecodedRequest
 31  
 {
 32  0
     private String _scheme = "http";
 33  
 
 34  
     private String _serverName;
 35  
 
 36  
     private String _requestURI;
 37  
 
 38  0
     private int _serverPort = 80;
 39  
 
 40  
     public DecodedRequest()
 41  0
     {
 42  0
     }
 43  
 
 44  
     /**
 45  
      * Initializes default values for the properties from the request provided.
 46  
      * 
 47  
      * @since 4.0
 48  
      */
 49  
 
 50  
     public DecodedRequest(HttpServletRequest request)
 51  0
     {
 52  0
         _scheme = request.getScheme();
 53  0
         _serverName = request.getServerName();
 54  0
         _requestURI = request.getRequestURI();
 55  0
         _serverPort = request.getServerPort();
 56  0
     }
 57  
 
 58  
     /**
 59  
      * Default value is 80.
 60  
      */
 61  
 
 62  
     public int getServerPort()
 63  
     {
 64  0
         return _serverPort;
 65  
     }
 66  
 
 67  
     /**
 68  
      * Default value is 'http'.
 69  
      */
 70  
 
 71  
     public String getScheme()
 72  
     {
 73  0
         return _scheme;
 74  
     }
 75  
 
 76  
     /**
 77  
      * No default, a value must be set by the decoder.
 78  
      */
 79  
 
 80  
     public String getServerName()
 81  
     {
 82  0
         return _serverName;
 83  
     }
 84  
 
 85  
     /**
 86  
      * No default, a value must be set by the decoder.
 87  
      */
 88  
 
 89  
     public String getRequestURI()
 90  
     {
 91  0
         return _requestURI;
 92  
     }
 93  
 
 94  
     public void setServerPort(int serverPort)
 95  
     {
 96  0
         _serverPort = serverPort;
 97  0
     }
 98  
 
 99  
     public void setScheme(String scheme)
 100  
     {
 101  0
         _scheme = scheme;
 102  0
     }
 103  
 
 104  
     public void setServerName(String serverName)
 105  
     {
 106  0
         _serverName = serverName;
 107  0
     }
 108  
 
 109  
     public void setRequestURI(String URI)
 110  
     {
 111  0
         _requestURI = URI;
 112  0
     }
 113  
 
 114  
 }