|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.apache.turbine.util.pool.RecyclableSupport
org.apache.turbine.util.parser.BaseValueParser
org.apache.turbine.util.parser.DefaultParameterParser
DefaultParameterParser 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.
| Field Summary |
| Fields inherited from interface org.apache.turbine.util.parser.ValueParser |
URL_CASE_FOLDING, URL_CASE_FOLDING_LOWER, URL_CASE_FOLDING_NONE, URL_CASE_FOLDING_UPPER |
| Constructor Summary | |
DefaultParameterParser()
Create a new empty instance of ParameterParser. |
|
DefaultParameterParser(java.lang.String characterEncoding)
Create a new empty instance of ParameterParser. |
|
| Method Summary | |
void |
add(java.lang.String name,
org.apache.commons.fileupload.FileItem item)
Add a FileItem object as a parameters. |
void |
append(java.lang.String name,
org.apache.commons.fileupload.FileItem item)
Deprecated. Use add(String name, FileItem item) |
boolean |
containsKey(java.lang.Object key)
Determine whether a given key has been inserted. |
void |
dispose()
Disposes the parser. |
org.apache.commons.fileupload.FileItem |
getFileItem(java.lang.String name)
Return a FileItem object for the given name. |
protected org.apache.commons.fileupload.FileItem[] |
getFileItemParam(java.lang.String name)
fetches a key from the parameters map. |
org.apache.commons.fileupload.FileItem[] |
getFileItems(java.lang.String name)
Return an array of FileItem objects for the given name. |
javax.servlet.http.HttpServletRequest |
getRequest()
Gets the parsed servlet request. |
protected java.lang.Object[] |
getToStringParam(java.lang.String name)
This method is only used in toString() and can be used by derived classes to add their local parameters to the toString() |
byte[] |
getUploadData()
Gets the uploadData byte[] |
java.util.Set |
keySet()
Gets the set of keys (FileItems and regular parameters) |
protected void |
putFileItemParam(java.lang.String name,
org.apache.commons.fileupload.FileItem[] value)
Puts a key into the parameters map. |
void |
setRequest(javax.servlet.http.HttpServletRequest request)
Sets the servlet request to the parser. |
void |
setUploadData(byte[] uploadData)
Sets the uploadData byte[] |
| Methods inherited from class org.apache.turbine.util.pool.RecyclableSupport |
doDispose, isDisposed, Recyclable, recycle |
| 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.pool.Recyclable |
isDisposed, recycle |
| Constructor Detail |
public DefaultParameterParser()
To add name/value pairs to this set of parameters, use the
add() methods.
public DefaultParameterParser(java.lang.String characterEncoding)
To add name/value pairs to this set of parameters, use the
add() methods.
characterEncoding - The character encoding of strings.| Method Detail |
public void dispose()
dispose in interface Recyclabledispose in class BaseValueParserpublic javax.servlet.http.HttpServletRequest getRequest()
getRequest in interface ParameterParserpublic void setRequest(javax.servlet.http.HttpServletRequest request)
To add name/value pairs to this set of parameters, use the
add() methods.
setRequest in interface ParameterParserrequest - An HttpServletRequest.public void setUploadData(byte[] uploadData)
setUploadData in interface ParameterParseruploadData - A byte[] with data.public byte[] getUploadData()
getUploadData in interface ParameterParser
public void append(java.lang.String name,
org.apache.commons.fileupload.FileItem item)
append in interface ParameterParsername - A String with the name.item - A FileItem with the value.
public void add(java.lang.String name,
org.apache.commons.fileupload.FileItem item)
add in interface ParameterParsername - A String with the name.item - A FileItem with the value.public java.util.Set keySet()
keySet in interface ValueParserkeySet in class BaseValueParserSet of the keys.public boolean containsKey(java.lang.Object key)
containsKey in interface ValueParsercontainsKey in class BaseValueParserkey - An Object with the key to search for.
public org.apache.commons.fileupload.FileItem getFileItem(java.lang.String name)
getFileItem in interface ParameterParsername - A String with the name.
public org.apache.commons.fileupload.FileItem[] getFileItems(java.lang.String name)
getFileItems in interface ParameterParsername - A String with the name.
protected void putFileItemParam(java.lang.String name,
org.apache.commons.fileupload.FileItem[] value)
name - A String with the name.value - An array of Objects with the values.protected org.apache.commons.fileupload.FileItem[] getFileItemParam(java.lang.String name)
name - A string with the name
protected java.lang.Object[] getToStringParam(java.lang.String name)
getToStringParam in class BaseValueParsername - A string with the name
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||