Class OutjectionFilter

  extended by org.mentawai.core.OutputWrapper
      extended by org.mentawai.filter.OutjectionFilter
All Implemented Interfaces:
java.util.Map<java.lang.String,java.lang.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.

Sergio Oliveira

Nested Class Summary
Nested classes/interfaces inherited from interface java.util.Map
Constructor Summary
          Creates a OutjectionFilter.
Method Summary
 void destroy()
          Gives a chance to the filter to deallocalte any resources before it is destroyed.
 java.lang.String filter(InvocationChain chain)
          Executes the filter.
 java.lang.Object getValue(java.lang.String key)
          Gets an output value by name.
Methods inherited from class org.mentawai.core.OutputWrapper
clear, containsKey, containsValue, entrySet, get, 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
Methods inherited from interface java.util.Map
equals, hashCode

Constructor Detail


public OutjectionFilter()
Creates a OutjectionFilter.

Method Detail


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

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


public java.lang.String filter(InvocationChain chain)
                        throws java.lang.Exception
Description copied from interface: Filter
Executes the filter.

Specified by:
filter in interface Filter
chain - The InvocationChain for the action this filter is being applied to.
The result of the filter or the action the filter is being applied to.


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 © 2005 Mentawai Team. All Rights Reserved.