Clover coverage report - Code Coverage for tapestry-portlet release 4.0.1
Coverage timestamp: Fri Mar 31 2006 09:14:58 EST
file stats: LOC: 72   Methods: 6
NCLOC: 36   Classes: 1
 
 Source file Conditionals Statements Methods TOTAL
UploadFormPortletParametersWrapper.java 0% 0% 0% 0%
coverage
 1    // Copyright 2006 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    package org.apache.tapestry.portlet.multipart;
 15   
 16    import java.util.Collections;
 17    import java.util.Enumeration;
 18    import java.util.Map;
 19   
 20    import javax.portlet.ActionRequest;
 21   
 22    import org.apache.hivemind.util.Defense;
 23    import org.apache.tapestry.multipart.ValuePart;
 24   
 25    /**
 26    * @author Raphael Jean
 27    *
 28    */
 29    public class UploadFormPortletParametersWrapper extends ActionRequestWrapper {
 30   
 31    /**
 32    * Map of {@link ValuePart} keyed on parameter name.
 33    */
 34    private Map _parameterMap;
 35   
 36  0 public UploadFormPortletParametersWrapper(ActionRequest request,
 37    Map parameterMap) {
 38  0 super(request);
 39   
 40  0 Defense.notNull(parameterMap, "parameterMap");
 41   
 42  0 _parameterMap = Collections.unmodifiableMap(parameterMap);
 43    }
 44   
 45  0 public String getParameter(String name)
 46    {
 47  0 String[] values = getParameterValues(name);
 48   
 49  0 return (values == null || values.length == 0) ? null : values[0];
 50    }
 51   
 52  0 public Map getParameterMap()
 53    {
 54  0 return _parameterMap;
 55    }
 56   
 57  0 public Enumeration getParameterNames()
 58    {
 59  0 return Collections.enumeration(_parameterMap.keySet());
 60    }
 61   
 62  0 public String[] getParameterValues(String name)
 63    {
 64  0 return (String[]) _parameterMap.get(name);
 65    }
 66   
 67  0 public String toString()
 68    {
 69  0 return "<UploadFormPortletParametersWrapper for " + getRequest() + ">";
 70    }
 71   
 72    }