org.mentawai.filter
Class ConverterFilter

java.lang.Object
  extended by org.mentawai.filter.ConverterFilter
All Implemented Interfaces:
Filter

public class ConverterFilter
extends Object
implements Filter

A filter to perform conversions of the action input values. This filter has the exact same behaviour of the ConversionFilter except that it will get the conversion information from the action if it implements the Convertable interface.

Author:
Sergio Oliveira

Constructor Summary
ConverterFilter()
          Creates a ConverterFilter.
ConverterFilter(boolean restore)
          Creates a ConverterFilter.
 
Method Summary
 void destroy()
          Gives a chance to the filter to deallocalte any resources before it is destroyed.
 String filter(InvocationChain chain)
          Executes the filter.
 void setRestore(boolean restore)
          Should this filter restore the old values after the action has executed?
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConverterFilter

public ConverterFilter()
Creates a ConverterFilter.


ConverterFilter

public ConverterFilter(boolean restore)
Creates a ConverterFilter.

Parameters:
restore - Restore the converted values after the action execution?
Since:
1.2
Method Detail

setRestore

public void setRestore(boolean restore)
Should this filter restore the old values after the action has executed?

Parameters:
restore - true to restore the values.
Since:
1.2

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 © 2013. All Rights Reserved.