org.apache.jetspeed.util.parser
Class DefaultJetspeedParameterParser

java.lang.Object
  extended byorg.apache.turbine.util.pool.RecyclableSupport
      extended byorg.apache.turbine.util.parser.BaseValueParser
          extended byorg.apache.turbine.util.parser.DefaultParameterParser
              extended byorg.apache.jetspeed.util.parser.DefaultJetspeedParameterParser
All Implemented Interfaces:
org.apache.turbine.util.ParameterParser, org.apache.turbine.util.pool.Recyclable, org.apache.turbine.util.ValueParser
Direct Known Subclasses:
ValidationParameterParser

public class DefaultJetspeedParameterParser
extends org.apache.turbine.util.parser.DefaultParameterParser

DefaultJetspeedParameterParser is a utility object to handle parsing and retrieving the data passed via the GET/POST/PATH_INFO arguments.

NOTE: The name= portion of a name=value pair may be converted to lowercase or uppercase when the object is initialized and when new data is added. This behaviour is determined by the url.case.folding property in TurbineResources.properties. Adding a name/value pair may overwrite existing name=value pairs if the names match:

 ParameterParser pp = data.getParameters();
 pp.add("ERROR",1);
 pp.add("eRrOr",2);
 int result = pp.getInt("ERROR");
 
In the above example, result is 2.

Version:
$Id: DefaultJetspeedParameterParser.java,v 1.6 2004/06/25 20:06:40 taylor Exp $
Author:
Shinsuke SUGAYA

Field Summary
 
Fields inherited from class org.apache.turbine.util.parser.BaseValueParser
parameters
 
Fields inherited from interface org.apache.turbine.util.ValueParser
URL_CASE_FOLDING, URL_CASE_FOLDING_LOWER, URL_CASE_FOLDING_NONE, URL_CASE_FOLDING_UPPER
 
Constructor Summary
DefaultJetspeedParameterParser()
           
DefaultJetspeedParameterParser(java.lang.String characterEncoding)
           
 
Method Summary
 java.lang.String getString(java.lang.String name)
          Return a String for the given name.
 void setRequest(javax.servlet.http.HttpServletRequest req)
          Sets the servlet request to be parser.
 
Methods inherited from class org.apache.turbine.util.parser.DefaultParameterParser
append, dispose, getFileItem, getFileItems, getRequest, getUploadData, setUploadData
 
Methods inherited from class org.apache.turbine.util.parser.BaseValueParser
add, add, add, add, add, append, clear, containsDateSelectorKeys, containsKey, containsTimeSelectorKeys, convert, convertAndTrim, get, getBigDecimal, getBigDecimal, getBigDecimals, getBool, getBool, getBoolean, getBoolean, getByte, getByte, getBytes, getCharacterEncoding, getDate, getDate, getDate, getDouble, getDouble, getFloat, getFloat, getInt, getInt, getInteger, getInteger, getInteger, getIntegers, getInts, getKeys, getLong, getLong, getLongObjects, getLongs, getNumberKey, getObject, getObjects, getString, getStringKey, getStrings, getStrings, keys, recycle, recycle, remove, setCharacterEncoding, setProperties, setProperty, setString, setStrings, toString
 
Methods inherited from class org.apache.turbine.util.pool.RecyclableSupport
doDispose, isDisposed, Recyclable
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.apache.turbine.util.ValueParser
add, add, add, add, add, append, clear, containsDateSelectorKeys, containsKey, convert, get, getBigDecimal, getBigDecimal, getBigDecimals, getBool, getBool, getBoolean, getBoolean, getByte, getByte, getBytes, getCharacterEncoding, getDate, getDate, getDate, getDouble, getDouble, getFloat, getFloat, getInt, getInt, getInteger, getInteger, getInteger, getIntegers, getInts, getKeys, getLong, getLong, getLongObjects, getLongs, getNumberKey, getObject, getObjects, getString, getStringKey, getStrings, getStrings, keys, remove, setCharacterEncoding, setProperties, setString, setStrings, toString
 
Methods inherited from interface org.apache.turbine.util.pool.Recyclable
isDisposed, recycle
 

Constructor Detail

DefaultJetspeedParameterParser

public DefaultJetspeedParameterParser()

DefaultJetspeedParameterParser

public DefaultJetspeedParameterParser(java.lang.String characterEncoding)
Method Detail

setRequest

public void setRequest(javax.servlet.http.HttpServletRequest req)
Sets the servlet request to be parser. This requires a valid HttpServletRequest object. It will attempt to parse out the GET/POST/PATH_INFO data and store the data into a Hashtable. There are convenience methods for retrieving the data as a number of different datatypes. The PATH_INFO data must be a URLEncoded() string.

To add name/value pairs to this set of parameters, use the add() methods.

Parameters:
req - An HttpServletRequest.

getString

public java.lang.String getString(java.lang.String name)
Return a String for the given name. If the name does not exist, return null.

Parameters:
name - A String with the name.
Returns:
A String.


Copyright © 2000-2005 Apache Software Foundation. All Rights Reserved.