|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.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.
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 | |
DefaultParameterParser()
Create a new empty instance of ParameterParser. |
|
DefaultParameterParser(java.lang.String characterEncoding)
Create a new empty instance of ParameterParser. |
Method Summary | |
void |
append(java.lang.String name,
FileItem value)
Add a FileItem object as a parameters. |
void |
dispose()
Disposes the parser. |
FileItem |
getFileItem(java.lang.String name)
Return a FileItem object for the given name. |
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. |
byte[] |
getUploadData()
Gets the uploadData byte[] |
void |
setRequest(javax.servlet.http.HttpServletRequest req)
Sets the servlet request to be parser. |
void |
setUploadData(byte[] uploadData)
Sets the uploadData byte[] |
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, 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, 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 |
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 Recyclable
dispose
in class BaseValueParser
public javax.servlet.http.HttpServletRequest getRequest()
getRequest
in interface ParameterParser
public void setRequest(javax.servlet.http.HttpServletRequest req)
To add name/value pairs to this set of parameters, use the
add()
methods.
setRequest
in interface ParameterParser
req
- An HttpServletRequest.public void setUploadData(byte[] uploadData)
setUploadData
in interface ParameterParser
uploadData
- A byte[] with data.public byte[] getUploadData()
getUploadData
in interface ParameterParser
public void append(java.lang.String name, FileItem value)
append
in interface ParameterParser
name
- A String with the name.value
- A FileItem with the value.public FileItem getFileItem(java.lang.String name)
getFileItem
in interface ParameterParser
name
- A String with the name.public FileItem[] getFileItems(java.lang.String name)
getFileItems
in interface ParameterParser
name
- A String with the name.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |