| org.apache.turbine.util.parser.ParameterParser
All known Subclasses: org.apache.turbine.util.parser.DefaultParameterParser,
ParameterParser | public interface ParameterParser extends ValueParser(Code) | | ParameterParser is an interface to a utility 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.
author: Ilkka Priha author: Jon S. Stevens author: Sean Legassick author: Henning P. Schmiedehausen version: $Id: ParameterParser.java 534527 2007-05-02 16:10:59Z tv $ |
add | void add(String name, FileItem item)(Code) | | Add a FileItem object as a parameters. If there are any
FileItems already associated with the name, append to the
array. The reason for this is that RFC 1867 allows multiple
files to be associated with single HTML input element.
Parameters: name - A String with the name. Parameters: item - A FileItem with the value. |
append | void append(String name, FileItem item)(Code) | | Add a FileItem object as a parameters. If there are any
FileItems already associated with the name, append to the
array. The reason for this is that RFC 1867 allows multiple
files to be associated with single HTML input element.
Parameters: name - A String with the name. Parameters: item - A FileItem with the value. |
getFileItem | FileItem getFileItem(String name)(Code) | | Return a FileItem object for the given name. If the name does
not exist or the object stored is not a FileItem, return null.
Parameters: name - A String with the name. A FileItem. |
getFileItems | FileItem[] getFileItems(String name)(Code) | | Return an array of FileItem objects for the given name. If the
name does not exist or the object stored is not a FileItem
array, return null.
Parameters: name - A String with the name. A FileItem[]. |
getUploadData | byte[] getUploadData()(Code) | | Gets the uploadData byte[]
uploadData A byte[] with data. |
setRequest | void setRequest(HttpServletRequest req)(Code) | | 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 Map.
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. |
setUploadData | void setUploadData(byte[] uploadData)(Code) | | Sets the uploadData byte[]
Parameters: uploadData - A byte[] with data. |
|
|