org.mentawai.core
Interface Output

All Known Implementing Classes:
MapOutput, OutjectionFilter, OutputWrapper, ResponseOutput

public interface Output

Defines the behavior of an action output. An output is like a map where you can put and remove values by name.

Author:
Sergio Oliveira

Method Summary
 String add(Object value)
          Add an object with a auto generated key.
 Object getValue(String name)
          Gets an output value by name.
 boolean has(String key)
          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.
 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 setValue(String name, Object value)
          Sets an output value by name.
 

Method Detail

setValue

void setValue(String name,
              Object value)
Sets an output value by name.

Parameters:
name - The name of the value
value - The value

getValue

Object getValue(String name)
Gets an output value by name.

Parameters:
name - The name of the value
Returns:
The value or null if it does not exist

removeValue

void removeValue(String name)
Removes an output value by name.

Parameters:
name - The name of the value

isEmpty

boolean isEmpty()
Returns true is this output has no values.

Returns:
true if this output has no values

keys

Iterator<String> keys()
Gets an iterator with the names of each output value.

Returns:
An iterator with all the names

setObject

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.

Parameters:
bean - The bean (object) from where to get the properties.

setObject

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. Use the given prefix when placing in the output.

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

has

boolean has(String key)
Check if the output has this key.

Parameters:
key -
Returns:
boolean

add

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

Parameters:
value -
Returns:
The key used to add this object to the output.


Copyright © 2013. All Rights Reserved.