org.apache.myfaces.trinidadinternal.share.data
Class ServletRequestParameters

java.lang.Object
  extended by org.apache.myfaces.trinidadinternal.share.data.RequestParameters
      extended by org.apache.myfaces.trinidadinternal.share.data.ServletRequestParameters

public class ServletRequestParameters
extends RequestParameters

Class wrapping up access to parameters. This allows the values and contents of these parameters to be modified from their values in the HttpServletRequest

Version:
$Name: $ ($Revision: adfrt/faces/adf-faces-impl/src/main/java/oracle/adfinternal/view/faces/share/data/ServletRequestParameters.java#0 $) $Date: 10-nov-2005.19:00:16 $
Author:
The Oracle ADF Faces Team

Field Summary
static java.lang.String HAS_COMPOUND_NAME
          Flag parameter indicating that the request contains a compound name that has to be parsed.
 
Constructor Summary
ServletRequestParameters(java.util.Map<java.lang.String,java.lang.Object> requestParams)
          Returns a request parameters object wrapping the parameters of a ServletRequest.
 
Method Summary
static java.util.Map<java.lang.String,java.lang.Object> createRequestMap(java.util.Map<java.lang.String,java.lang.Object> requestParams)
          Returns a Map containing the modified parameters and keys for Map of input request parameters.
static void decodeCompoundKeyValues(java.lang.String compoundValue, int startIndex, java.util.Map<java.lang.String,java.lang.Object> keyValues)
          Decodes key value pairs from a single value, placing the decoded values into the specified Map of String[]s.
static java.lang.String encodeCompoundKeyValues(java.util.Iterator<java.lang.Object> keyValues, int keyValueSize)
          Encodes an Iterator key value pairs as a single value appended to the baseName, if any;
static java.lang.String encodeCompoundKeyValues(java.util.Iterator<java.lang.Object> keyValues, int keyValueSize, java.util.Iterator<java.lang.Object> keyExchanges, int keyExchangesSize)
          Encodes an Iterator key value pairs as a single value appended to the baseName, if any.
static java.lang.String encodeCompoundKeyValues(java.lang.String namePrefix, java.util.Iterator<java.lang.Object> keyValues, int keyValueSize)
          Encodes an Iterator key value pairs as a single value appended to the baseName, if any;
static java.lang.String encodeCompoundKeyValues(java.lang.String namePrefix, java.util.Iterator<java.lang.Object> keyValues, int keyValueSize, java.lang.String exchangePrefix, java.util.Iterator<java.lang.Object> keyExchanges, int keyExchangesSize)
          Encodes an Iterator key value pairs as a single value appended to the baseName, if any;
 java.lang.String getParameter(java.lang.String name)
          Returns the value of a request parameter as a String, or null if the parameter does not exist.
 java.util.Iterator<java.lang.String> getParameterNames()
          Returns an Iterator of String objects containing the names of the parameters contained in this request.
 java.lang.String[] getParameterValues(java.lang.String name)
          Returns an array of String objects containing all of the values the given request parameter has, or null if the parameter does not exist.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

HAS_COMPOUND_NAME

public static final java.lang.String HAS_COMPOUND_NAME
Flag parameter indicating that the request contains a compound name that has to be parsed.

See Also:
Constant Field Values
Constructor Detail

ServletRequestParameters

public ServletRequestParameters(java.util.Map<java.lang.String,java.lang.Object> requestParams)
Returns a request parameters object wrapping the parameters of a ServletRequest.

Method Detail

createRequestMap

public static java.util.Map<java.lang.String,java.lang.Object> createRequestMap(java.util.Map<java.lang.String,java.lang.Object> requestParams)
Returns a Map containing the modified parameters and keys for Map of input request parameters.

If not modification is required the returned Dicitonary instance will be the requestParams instance.


decodeCompoundKeyValues

public static void decodeCompoundKeyValues(java.lang.String compoundValue,
                                           int startIndex,
                                           java.util.Map<java.lang.String,java.lang.Object> keyValues)
Decodes key value pairs from a single value, placing the decoded values into the specified Map of String[]s. This code does not currently handle multiple values for the same key.

adapted from org.apache.myfaces.trinidadinternal.uix22.servlet.url.DefaultPageEncoder


encodeCompoundKeyValues

public static java.lang.String encodeCompoundKeyValues(java.lang.String namePrefix,
                                                       java.util.Iterator<java.lang.Object> keyValues,
                                                       int keyValueSize)
Encodes an Iterator key value pairs as a single value appended to the baseName, if any;


encodeCompoundKeyValues

public static java.lang.String encodeCompoundKeyValues(java.lang.String namePrefix,
                                                       java.util.Iterator<java.lang.Object> keyValues,
                                                       int keyValueSize,
                                                       java.lang.String exchangePrefix,
                                                       java.util.Iterator<java.lang.Object> keyExchanges,
                                                       int keyExchangesSize)
Encodes an Iterator key value pairs as a single value appended to the baseName, if any;


encodeCompoundKeyValues

public static java.lang.String encodeCompoundKeyValues(java.util.Iterator<java.lang.Object> keyValues,
                                                       int keyValueSize)
Encodes an Iterator key value pairs as a single value appended to the baseName, if any;


encodeCompoundKeyValues

public static java.lang.String encodeCompoundKeyValues(java.util.Iterator<java.lang.Object> keyValues,
                                                       int keyValueSize,
                                                       java.util.Iterator<java.lang.Object> keyExchanges,
                                                       int keyExchangesSize)
Encodes an Iterator key value pairs as a single value appended to the baseName, if any.


getParameter

public java.lang.String getParameter(java.lang.String name)
Returns the value of a request parameter as a String, or null if the parameter does not exist. Request parameters are extra information sent with the request. For HTTP servlets, parameters are contained in the query string or posted form data.

You should only use this method when you are sure the parameter has only one value. If the parameter might have more than one value, use getParameterValues(java.lang.String).

If you use this method with a multivalued parameter, the value returned is equal to the first value in the array returned by getParameterValues.

Overrides:
getParameter in class RequestParameters
Parameters:
name - a String specifying the name of the parameter
Returns:
a String representing the single value of the parameter
See Also:
getParameterValues(java.lang.String)

getParameterNames

public java.util.Iterator<java.lang.String> getParameterNames()
Returns an Iterator of String objects containing the names of the parameters contained in this request. If the request has no parameters, the method returns an empty Iterator.

Specified by:
getParameterNames in class RequestParameters
Returns:
an Iterator of String objects, each String containing the name of a request parameter; or an empty Iterator if the request has no parameters

getParameterValues

public java.lang.String[] getParameterValues(java.lang.String name)
Returns an array of String objects containing all of the values the given request parameter has, or null if the parameter does not exist.

If the parameter has a single value, the array has a length of 1.

Specified by:
getParameterValues in class RequestParameters
Parameters:
name - a String containing the name of the parameter whose value is requested
Returns:
an array of String objects containing the parameter's values
See Also:
getParameter(java.lang.String)


Copyright © 2001-2007 Apache Software Foundation. All Rights Reserved.