org.mentawai.filter
Class OutjectionFilter
java.lang.Object
org.mentawai.core.OutputWrapper
org.mentawai.filter.OutjectionFilter
- All Implemented Interfaces:
- Map<String,Object>, Filter, Output
public class OutjectionFilter
- extends OutputWrapper
- implements Filter
A filter that takes all the properties of the action and place them in the output,
so that you don't have to call output.setValue() manually.
Note that for plain ations this filter uses the method action.getClass().getDeclaredMethods()
in order to find the getters, in other words,
it will only find getters of the base class and not from its superclasses. This is ok because
action inheritance is not very common.
If you are using a POJO action or a model-driven action it will use the method getMethods instead.
For ModelDriven actions, the method action.getModel().getClass().getMethods() is used instead,
pretty much like in the OVFilter.
- Author:
- Sergio Oliveira
| Nested classes/interfaces inherited from interface java.util.Map |
Map.Entry<K,V> |
| Methods inherited from class org.mentawai.core.OutputWrapper |
add, clear, containsKey, containsValue, entrySet, get, has, isEmpty, keys, keySet, put, putAll, remove, removeValue, setObject, setObject, setOutput, setValue, size, values |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
OutjectionFilter
public OutjectionFilter()
- Creates a OutjectionFilter.
getValue
public Object getValue(String key)
- Description copied from interface:
Output
- Gets an output value by name.
- Specified by:
getValue in interface Output- Overrides:
getValue in class OutputWrapper
- Parameters:
key - The name of the value
- Returns:
- The value or null if it does not exist
filter
public String filter(InvocationChain chain)
throws Exception
- Description copied from interface:
Filter
- Executes the filter.
- Specified by:
filter in interface Filter
- Parameters:
chain - The InvocationChain for the action this filter is being applied to.
- Returns:
- The result of the filter or the action the filter is being applied to.
- Throws:
Exception
destroy
public void destroy()
- Description copied from interface:
Filter
- Gives a chance to the filter to deallocalte any resources before it is destroyed.
This is called when the web application is stopped, in other words,
this has nothing to do with garbage collection.
- Specified by:
destroy in interface Filter
Copyright © 2012. All Rights Reserved.