org.apache.tapestry.util
Class QueryParameterMap

java.lang.Object
  extended by org.apache.tapestry.util.QueryParameterMap

public class QueryParameterMap
extends Object

A wrapper around a Map that stores query parameter values. Map keys are strings. Map values can be simple strings or array of string (or null).

Since:
4.0
Author:
Howard M. Lewis Ship

Constructor Summary
QueryParameterMap()
           
QueryParameterMap(Map parameterMap)
          Constructor around an existing Map whose keys and values are expected to conform expected use (keys are strings, values are null, string or string array).
 
Method Summary
 String[] getParameterNames()
          Returns the names of all parameters, sorted alphabetically.
 String getParameterValue(String name)
          Gets a query parameter value.
 String[] getParameterValues(String name)
          Returns the array of values for the specified parameter.
 void setParameterValue(String name, String value)
          Replaces the parameter value for the given name wit the new value (which may be null).
 void setParameterValues(String name, String[] values)
          Replaces the parameter value for the given name wit the new list of values (which may be empty or null).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QueryParameterMap

public QueryParameterMap()

QueryParameterMap

public QueryParameterMap(Map parameterMap)
Constructor around an existing Map whose keys and values are expected to conform expected use (keys are strings, values are null, string or string array). The map passed in is retained ( not copied).

Method Detail

setParameterValue

public void setParameterValue(String name,
                              String value)
Replaces the parameter value for the given name wit the new value (which may be null).


setParameterValues

public void setParameterValues(String name,
                               String[] values)
Replaces the parameter value for the given name wit the new list of values (which may be empty or null).


getParameterValue

public String getParameterValue(String name)
Gets a query parameter value. If an array of values was stored, this returns the first value. May return null.


getParameterValues

public String[] getParameterValues(String name)
Returns the array of values for the specified parameter. If only a lone value was stored (via setParameterValue(String, String), then the value is wrapped as a string array and returned.


getParameterNames

public String[] getParameterNames()
Returns the names of all parameters, sorted alphabetically.



Copyright © 2006-2008 Apache Software Foundation. All Rights Reserved.