org.mentawai.core
Class OutputWrapper

java.lang.Object
  extended by org.mentawai.core.OutputWrapper
All Implemented Interfaces:
Map<String,Object>, Output
Direct Known Subclasses:
OutjectionFilter

public class OutputWrapper
extends Object
implements Output, Map<String,Object>


Nested Class Summary
 
Nested classes/interfaces inherited from interface java.util.Map
Map.Entry<K,V>
 
Constructor Summary
OutputWrapper()
           
 
Method Summary
 String add(Object value)
          Add an object with a auto generated key.
 void clear()
           
 boolean containsKey(Object key)
           
 boolean containsValue(Object value)
           
 Set<Map.Entry<String,Object>> entrySet()
           
 Object get(Object key)
           
 Object getValue(String name)
          Gets an output value by name.
 boolean has(String name)
          Check if the output has this key.
 boolean isEmpty()
          Returns true is this output has no values.
 Iterator<String> keys()
          Gets an iterator with the names of each output value.
 Set<String> keySet()
           
 Object put(String key, Object value)
           
 void putAll(Map<? extends String,? extends Object> t)
           
 Object remove(Object key)
           
 void removeOutput()
           
 void removeValue(String name)
          Removes an output value by name.
 void setObject(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(Object bean, 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 setOutput(Output output)
           
 void setValue(String name, Object value)
          Sets an output value by name.
 int size()
           
 Collection<Object> values()
           
 
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
 

Constructor Detail

OutputWrapper

public OutputWrapper()
Method Detail

setOutput

public void setOutput(Output output)

removeOutput

public void removeOutput()

setValue

public void setValue(String name,
                     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

has

public boolean has(String name)
Description copied from interface: Output
Check if the output has this key.

Specified by:
has in interface Output
Returns:
boolean

add

public String add(Object value)
Description copied from interface: Output
Add an object with a auto generated key. This can be used when you don't care about the key, for example for streams.

Specified by:
add in interface Output
Returns:
The key used to add this object to the output.

getValue

public Object getValue(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(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 Map<String,Object>
Specified by:
isEmpty in interface Output
Returns:
true if this output has no values

setObject

public void setObject(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(Object bean,
                      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.

keys

public Iterator<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 Map<String,Object>

containsKey

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

containsValue

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

entrySet

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

get

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

keySet

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

put

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

putAll

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

remove

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

size

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

values

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


Copyright © 2013. All Rights Reserved.