|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.mentawai.filter.PushInjectionFilter
public class PushInjectionFilter
A filter that tries to inject the input values in the action through setters. (Ex. setUsername(), setPassword(), etc.) It can also inject the input value directly in the attribute, even if it is a private field. Use this filter if you don't want to deal with the action input object and instaed you want to inject its values in the action. This filter tries to inject all the input values in the action. If enabled (default), it will also try to convert the values automatically by looking into the action field by reflection.
| Constructor Summary | |
|---|---|
PushInjectionFilter()
Creates an PushInjectionFilter that can be used by any action class. |
|
PushInjectionFilter(boolean tryField)
Creates an PushInjectionFilter that can be used by any action class. |
|
PushInjectionFilter(boolean tryField,
boolean convert)
Creates an PushInjectionFilter that can be used by any action class. |
|
| 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. |
protected Object |
getConvertedValue(String className,
String value,
Locale loc)
You can override this method to code more automatic conversions. |
protected boolean |
setValue(Object target,
String name,
Object value,
Locale loc)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public PushInjectionFilter()
public PushInjectionFilter(boolean tryField)
tryField - A flag indicating whether this filter should try to access private attributes.
public PushInjectionFilter(boolean tryField,
boolean convert)
tryField - A flag indicating whether this filter should try to access private attributes.| Method Detail |
|---|
protected Object getConvertedValue(String className,
String value,
Locale loc)
className - The type to convert tovalue - The value to convertloc - The locale to use for conversion (useful for date)
protected boolean setValue(Object target,
String name,
Object value,
Locale loc)
public String filter(InvocationChain chain)
throws Exception
Filter
filter in interface Filterchain - The InvocationChain for the action this filter is being applied to.
Exceptionpublic void destroy()
Filter
destroy in interface Filter
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||