Clover coverage report - Code Coverage for tapestry release 4.0-beta-12
Coverage timestamp: Sun Oct 30 2005 16:22:01 EST
file stats: LOC: 98   Methods: 0
NCLOC: 11   Classes: 1
 
 Source file Conditionals Statements Methods TOTAL
ServiceEncoding.java - - - -
coverage
 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.engine;
 16   
 17    /**
 18    * Contains the information needed to encode a request for a service; the servlet path plus and
 19    * query parameters. The service encoding is passed to each
 20    * {@link org.apache.tapestry.engine.ServiceEncoder} , which is allowed to modify the encoding
 21    * (typically, by changing the servlet path and settting query parameters to null). From this
 22    * modified encoding, an {@link org.apache.tapestry.engine.ILink}can be constructed.
 23    * <p>
 24    * Additionally, when a request is dispatched by Tapestry, an SRE is also created and passed to each
 25    * {@link org.apache.tapestry.engine.ServiceEncoder}&nbsp;for decoding. Here, the query parameters
 26    * that may have been nulled out by the encoding are restored.
 27    *
 28    * @author Howard M. Lewis Ship
 29    * @since 4.0
 30    * @see org.apache.tapestry.services.ServiceConstants
 31    */
 32    public interface ServiceEncoding
 33    {
 34   
 35    /**
 36    * Returns the value for the named parameter. If multiple values are stored for the query
 37    * parameter, only the first is returned.
 38    *
 39    * @parameter name the name of the query parameter to access
 40    * @return the value, or null if no such query parameter exists
 41    */
 42   
 43    public String getParameterValue(String name);
 44   
 45    /**
 46    * Returns the value for the named parameter.
 47    *
 48    * @parameter name the name of the query parameter to access
 49    * @return the values, or null if no such query parameter exists
 50    */
 51    public String[] getParameterValues(String name);
 52   
 53    /**
 54    * Updates the servlet path for the encoding. In some cases, this is a combination of the
 55    * servlet and additional path info.
 56    */
 57   
 58    public void setServletPath(String servletPath);
 59   
 60    /**
 61    * Sets the value for the named query parameter to the provided string.
 62    *
 63    * @param name
 64    * the name of the parameter to set.
 65    * @param value
 66    * the new value, which may be null.
 67    */
 68    public void setParameterValue(String name, String value);
 69   
 70    /**
 71    * Sets the values for a named query parameter.
 72    */
 73   
 74    public void setParameterValues(String name, String[] values);
 75   
 76    /**
 77    * Returns the servlet path for the request. This is the portion of the URL recognized as the
 78    * servlet. When the URL pattern (in web.xml) ends in a "*" (such as "/book/*"), this method
 79    * will return the matched servlet portion ("/book/") and {#link #getPathInfo} will return the
 80    * rest of the URL.
 81    */
 82   
 83    public String getServletPath();
 84   
 85    /**
 86    * Returns the portion of the URL after the servlet itself.
 87    *
 88    * @return pathInfo if path info was supplied in the request, or null otherwise.
 89    */
 90    public String getPathInfo();
 91   
 92    /**
 93    * Returns an array of parameter names. The names are returned in alphabetically sorted order.
 94    * This list includes all parameter names, even those for which the stored value is null.
 95    */
 96   
 97    public String[] getParameterNames();
 98    }