net.sf.doolin.gui.action.task
Class MethodGUITask<B,R>

java.lang.Object
  extended by net.sf.doolin.gui.action.task.AbstractGUITask<B,R>
      extended by net.sf.doolin.gui.action.task.MethodGUITask<B,R>
Type Parameters:
B - Type of bean sent to the task
R - Type of bean returned by the task
All Implemented Interfaces:
GUITask<B,R>

public class MethodGUITask<B,R>
extends AbstractGUITask<B,R>

Task based on the call of a method.

Author:
Damien Coraboeuf

Constructor Summary
MethodGUITask()
           
 
Method Summary
 R doInBackground(ActionContext actionContext, B bean)
          Gets the property on bean defined by the propertyPath property and calls the methodName method on it.
 void doOnResult(ActionContext actionContext, B bean, R result)
          Does nothing.
 void setMethodName(String methodName)
          Sets the method to call on the target property
 void setPropertyPath(String propertyPath)
          Sets the path to the property of the input bean of the task.
 
Methods inherited from class net.sf.doolin.gui.action.task.AbstractGUITask
doOnException, isDelegateException, setDelegateException
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MethodGUITask

public MethodGUITask()
Method Detail

doInBackground

public R doInBackground(ActionContext actionContext,
                        B bean)
                 throws Exception
Gets the property on bean defined by the propertyPath property and calls the methodName method on it.

Parameters:
actionContext - Initial action context
bean - Bean sent to the task
Returns:
Bean returned by the task
Throws:
Exception - In case of failure

doOnResult

public void doOnResult(ActionContext actionContext,
                       B bean,
                       R result)
Does nothing.

Parameters:
actionContext - Initial action context
bean - Bean sent to the task
result - Bean returned by the task

setMethodName

public void setMethodName(String methodName)
Sets the method to call on the target property

Parameters:
methodName - Method name

setPropertyPath

public void setPropertyPath(String propertyPath)
Sets the path to the property of the input bean of the task. It is set to "this" by default.

Parameters:
propertyPath - Property path


Copyright © 2011. All Rights Reserved.