org.mentawai.core
Class ResponseOutput

java.lang.Object
  extended by org.mentawai.core.ResponseOutput
All Implemented Interfaces:
java.util.Map<java.lang.String,java.lang.Object>, Output

public class ResponseOutput
extends java.lang.Object
implements Output, java.util.Map<java.lang.String,java.lang.Object>

A simple Output implementation backed up by a java.util.HashMap. This class also implements the java.util.Map interface so it can be used with JSP Expression Language. This class wraps the HttpServletResponse but does not use it. You may access it through the getResponse() method. Most of map operations are not supported.

Author:
Sergio Oliveira

Nested Class Summary
 
Nested classes/interfaces inherited from interface java.util.Map
java.util.Map.Entry<K,V>
 
Constructor Summary
ResponseOutput(javax.servlet.http.HttpServletResponse res)
           
 
Method Summary
 void clear()
           
 boolean containsKey(java.lang.Object key)
           
 boolean containsValue(java.lang.Object value)
           
 java.util.Set<java.util.Map.Entry<java.lang.String,java.lang.Object>> entrySet()
           
 java.lang.Object get(java.lang.Object key)
           
 javax.servlet.http.HttpServletResponse getResponse()
           
 java.lang.Object getValue(java.lang.String name)
          Gets an output value by name.
 boolean isEmpty()
          Returns true is this output has no values.
 java.util.Iterator<java.lang.String> keys()
          Gets an iterator with the names of each output value.
 java.util.Set<java.lang.String> keySet()
           
 java.lang.Object put(java.lang.String key, java.lang.Object value)
           
 void putAll(java.util.Map<? extends java.lang.String,? extends java.lang.Object> t)
           
 java.lang.Object remove(java.lang.Object key)
           
 void removeValue(java.lang.String name)
          Removes an output value by name.
 void setObject(java.lang.Object bean)
          Sets the properties of the given bean in the action output, in other words, extract all attributes from the given object and place them in the action output.
 void setObject(java.lang.Object bean, java.lang.String prefix)
          Sets the properties of the given bean in the action output, in other words, extract all attributes from the given object and place them in the action output.
 void setValue(java.lang.String name, java.lang.Object value)
          Sets an output value by name.
 int size()
           
 java.lang.String toString()
           
 java.util.Collection<java.lang.Object> values()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Map
equals, hashCode
 

Constructor Detail

ResponseOutput

public ResponseOutput(javax.servlet.http.HttpServletResponse res)
Method Detail

getResponse

public javax.servlet.http.HttpServletResponse getResponse()

setValue

public void setValue(java.lang.String name,
                     java.lang.Object value)
Description copied from interface: Output
Sets an output value by name.

Specified by:
setValue in interface Output
Parameters:
name - The name of the value
value - The value

getValue

public java.lang.Object getValue(java.lang.String name)
Description copied from interface: Output
Gets an output value by name.

Specified by:
getValue in interface Output
Parameters:
name - The name of the value
Returns:
The value or null if it does not exist

removeValue

public void removeValue(java.lang.String name)
Description copied from interface: Output
Removes an output value by name.

Specified by:
removeValue in interface Output
Parameters:
name - The name of the value

isEmpty

public boolean isEmpty()
Description copied from interface: Output
Returns true is this output has no values.

Specified by:
isEmpty in interface java.util.Map<java.lang.String,java.lang.Object>
Specified by:
isEmpty in interface Output
Returns:
true if this output has no values

setObject

public void setObject(java.lang.Object bean)
Description copied from interface: Output
Sets the properties of the given bean in the action output, in other words, extract all attributes from the given object and place them in the action output.

Specified by:
setObject in interface Output
Parameters:
bean - The bean (object) from where to get the properties.

setObject

public void setObject(java.lang.Object bean,
                      java.lang.String prefix)
Description copied from interface: Output
Sets the properties of the given bean in the action output, in other words, extract all attributes from the given object and place them in the action output. Use the given prefix when placing in the output.

Specified by:
setObject in interface Output
Parameters:
bean - The bean (object) from where to get the properties.
prefix - The prefix to use when placing the properties in the output.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

keys

public java.util.Iterator<java.lang.String> keys()
Description copied from interface: Output
Gets an iterator with the names of each output value.

Specified by:
keys in interface Output
Returns:
An iterator with all the names

clear

public void clear()
Specified by:
clear in interface java.util.Map<java.lang.String,java.lang.Object>

containsKey

public boolean containsKey(java.lang.Object key)
Specified by:
containsKey in interface java.util.Map<java.lang.String,java.lang.Object>

containsValue

public boolean containsValue(java.lang.Object value)
Specified by:
containsValue in interface java.util.Map<java.lang.String,java.lang.Object>

entrySet

public java.util.Set<java.util.Map.Entry<java.lang.String,java.lang.Object>> entrySet()
Specified by:
entrySet in interface java.util.Map<java.lang.String,java.lang.Object>

get

public java.lang.Object get(java.lang.Object key)
Specified by:
get in interface java.util.Map<java.lang.String,java.lang.Object>

keySet

public java.util.Set<java.lang.String> keySet()
Specified by:
keySet in interface java.util.Map<java.lang.String,java.lang.Object>

put

public java.lang.Object put(java.lang.String key,
                            java.lang.Object value)
Specified by:
put in interface java.util.Map<java.lang.String,java.lang.Object>

putAll

public void putAll(java.util.Map<? extends java.lang.String,? extends java.lang.Object> t)
Specified by:
putAll in interface java.util.Map<java.lang.String,java.lang.Object>

remove

public java.lang.Object remove(java.lang.Object key)
Specified by:
remove in interface java.util.Map<java.lang.String,java.lang.Object>

size

public int size()
Specified by:
size in interface java.util.Map<java.lang.String,java.lang.Object>

values

public java.util.Collection<java.lang.Object> values()
Specified by:
values in interface java.util.Map<java.lang.String,java.lang.Object>


Copyright © 2005 Mentawai Team. All Rights Reserved.