|
|||||||||
| Home >> All >> org >> mentawai >> [ core overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
org.mentawai.core
Class InputRequest

java.lang.Objectorg.mentawai.core.InputRequest
- All Implemented Interfaces:
- Input, java.util.Map
- public class InputRequest
- extends java.lang.Object
- implements Input, java.util.Map
- extends java.lang.Object
Encapsulates a HttpServletRequest as an Input for Mentawai actions. This class also implements the java.util.Map interface so it can be used with JSP Expression Language. Most of map operations are not supported.
- Version:
- $Id: InputRequest.java,v 1.10 2005/09/29 16:04:54 soliveira Exp $
| Nested Class Summary |
| Nested classes inherited from class java.util.Map |
java.util.Map.Entry |
| Field Summary | |
protected java.util.Map |
map
|
protected javax.servlet.http.HttpServletRequest |
req
|
| Constructor Summary | |
InputRequest(javax.servlet.http.HttpServletRequest req)
Creates an Input for the given HttpServletRequest. |
|
| Method Summary | |
void |
clear()
Remove all entries from this Map (optional operation). |
private java.util.Map |
clone(java.util.Map map)
|
boolean |
containsKey(java.lang.Object key)
Returns true if this contains a mapping for the given key. |
boolean |
containsValue(java.lang.Object value)
Returns true if this contains at least one mapping with the given value. |
java.util.Set |
entrySet()
Returns a set view of the mappings in this Map. |
java.lang.Object |
get(java.lang.Object key)
Returns the value mapped by the given key. |
java.lang.String |
getHeader(java.lang.String name)
Gets a header value from this input. |
int |
getIntValue(java.lang.String name)
Calls getStringValue() and tries to convert the string to an int. |
int[] |
getIntValues(java.lang.String name)
Calls getStringValues() and tries to convert each string value to an int. |
javax.servlet.http.HttpServletRequest |
getRequest()
Gets the HttpServletRequest this input encapsulates. |
java.lang.String |
getStringValue(java.lang.String name)
If the parameter is not a String, its toString() method is called. |
java.lang.String[] |
getStringValues(java.lang.String name)
If the parameter is not a String or a String array, a InputException will be thrown. |
java.lang.Object |
getValue(java.lang.String name)
Gets a parameter value (any object) with the given name. |
boolean |
isEmpty()
Returns true if the map contains no mappings. |
java.util.Iterator |
keys()
Gets an iterator with all the parameter names. |
java.util.Set |
keySet()
Returns a set view of the keys in this Map. |
java.lang.Object |
put(java.lang.Object key,
java.lang.Object value)
Associates the given key to the given value (optional operation). |
void |
putAll(java.util.Map map)
Copies all entries of the given map to this one (optional operation). |
java.lang.Object |
remove(java.lang.Object key)
Removes the mapping for this key if present (optional operation). |
void |
removeValue(java.lang.String name)
Removes a parameter from this input. |
void |
setValue(java.lang.String name,
java.lang.Object value)
Sets a parameter value with the given name. |
int |
size()
Returns the number of key-value mappings in the map. |
java.util.Collection |
values()
Returns a collection (or bag) view of the values in this Map. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface java.util.Map |
equals, hashCode |
| Field Detail |
map
protected java.util.Map map
req
protected javax.servlet.http.HttpServletRequest req
| Constructor Detail |
InputRequest
public InputRequest(javax.servlet.http.HttpServletRequest req)
- Creates an Input for the given HttpServletRequest.
| Method Detail |
clone
private java.util.Map clone(java.util.Map map)
getRequest
public javax.servlet.http.HttpServletRequest getRequest()
- Gets the HttpServletRequest this input encapsulates.
getHeader
public java.lang.String getHeader(java.lang.String name)
- Description copied from interface:
Input - Gets a header value from this input.
keys
public java.util.Iterator keys()
- Description copied from interface:
Input - Gets an iterator with all the parameter names.
removeValue
public void removeValue(java.lang.String name)
- Description copied from interface:
Input - Removes a parameter from this input.
- Specified by:
removeValuein interfaceInput
getStringValue
public java.lang.String getStringValue(java.lang.String name)
- If the parameter is not a String, its toString() method is called.
- Specified by:
getStringValuein interfaceInput
getStringValues
public java.lang.String[] getStringValues(java.lang.String name)
- If the parameter is not a String or a String array, a InputException will be thrown.
If the parameter is a String, a String array of size one with the string is returned.
- Specified by:
getStringValuesin interfaceInput
getIntValue
public int getIntValue(java.lang.String name)
- Calls getStringValue() and tries to convert the string to an int.
- Specified by:
getIntValuein interfaceInput
getIntValues
public int[] getIntValues(java.lang.String name)
- Calls getStringValues() and tries to convert each string value to an int.
- Specified by:
getIntValuesin interfaceInput
setValue
public void setValue(java.lang.String name, java.lang.Object value)
- Description copied from interface:
Input - Sets a parameter value with the given name.
The parameter can be any object.
If the parameter already exists the old value is substituted by the new one.
getValue
public java.lang.Object getValue(java.lang.String name)
- Description copied from interface:
Input - Gets a parameter value (any object) with the given name.
clear
public void clear()
- Description copied from interface:
java.util.Map - Remove all entries from this Map (optional operation).
- Specified by:
clearin interfacejava.util.Map
isEmpty
public boolean isEmpty()
- Description copied from interface:
java.util.Map - Returns true if the map contains no mappings.
- Specified by:
isEmptyin interfacejava.util.Map
containsKey
public boolean containsKey(java.lang.Object key)
- Description copied from interface:
java.util.Map - Returns true if this contains a mapping for the given key.
- Specified by:
containsKeyin interfacejava.util.Map
containsValue
public boolean containsValue(java.lang.Object value)
- Description copied from interface:
java.util.Map - Returns true if this contains at least one mapping with the given value.
In other words, returns true if a value v exists where
(value == null ? v == null : value.equals(v)). This usually requires linear time.- Specified by:
containsValuein interfacejava.util.Map
entrySet
public java.util.Set entrySet()
- Description copied from interface:
java.util.Map - Returns a set view of the mappings in this Map. Each element in the
set is a Map.Entry. The set is backed by the map, so that changes in
one show up in the other. Modifications made while an iterator is
in progress cause undefined behavior. If the set supports removal,
these methods remove the underlying mapping from the map:
Iterator.remove,Set.remove,removeAll,retainAll, andclear. Element addition, viaaddoraddAll, is not supported via this set.- Specified by:
entrySetin interfacejava.util.Map
get
public java.lang.Object get(java.lang.Object key)
- Description copied from interface:
java.util.Map - Returns the value mapped by the given key. Returns
nullif there is no mapping. However, in Maps that accept null values, you must rely oncontainsKeyto determine if a mapping exists.- Specified by:
getin interfacejava.util.Map
keySet
public java.util.Set keySet()
- Description copied from interface:
java.util.Map - Returns a set view of the keys in this Map. The set is backed by the
map, so that changes in one show up in the other. Modifications made
while an iterator is in progress cause undefined behavior. If the set
supports removal, these methods remove the underlying mapping from
the map:
Iterator.remove,Set.remove,removeAll,retainAll, andclear. Element addition, viaaddoraddAll, is not supported via this set.- Specified by:
keySetin interfacejava.util.Map
put
public java.lang.Object put(java.lang.Object key, java.lang.Object value)
- Description copied from interface:
java.util.Map - Associates the given key to the given value (optional operation). If the
map already contains the key, its value is replaced. Be aware that in
a map that permits
nullvalues, a null return does not always imply that the mapping was created.- Specified by:
putin interfacejava.util.Map
putAll
public void putAll(java.util.Map map)
- Description copied from interface:
java.util.Map - Copies all entries of the given map to this one (optional operation). If
the map already contains a key, its value is replaced.
- Specified by:
putAllin interfacejava.util.Map
remove
public java.lang.Object remove(java.lang.Object key)
- Description copied from interface:
java.util.Map - Removes the mapping for this key if present (optional operation). If
the key is not present, this returns null. Note that maps which permit
null values may also return null if the key was removed.
- Specified by:
removein interfacejava.util.Map
size
public int size()
- Description copied from interface:
java.util.Map - Returns the number of key-value mappings in the map. If there are more
than Integer.MAX_VALUE mappings, return Integer.MAX_VALUE.
- Specified by:
sizein interfacejava.util.Map
values
public java.util.Collection values()
- Description copied from interface:
java.util.Map - Returns a collection (or bag) view of the values in this Map. The
collection is backed by the map, so that changes in one show up in
the other. Modifications made while an iterator is in progress cause
undefined behavior. If the collection supports removal, these methods
remove the underlying mapping from the map:
Iterator.remove,Collection.remove,removeAll,retainAll, andclear. Element addition, viaaddoraddAll, is not supported via this collection.- Specified by:
valuesin interfacejava.util.Map
|
|||||||||
| Home >> All >> org >> mentawai >> [ core overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC
org.mentawai.core.InputRequest