org.springframework.binding.method
Class MethodInvoker
java.lang.Object
org.springframework.binding.method.MethodInvoker
public class MethodInvoker
- extends Object
A helper for invoking typed methods on arbitrary objects, with support for argument value type conversion from values
retrieved from an argument attribute source, and conversion of the result to a desired type.
- Author:
- Keith Donald, Jeremy Grelle
MethodInvoker
public MethodInvoker()
setConversionService
public void setConversionService(ConversionService conversionService)
- Sets the conversion service to convert argument values as needed.
invoke
public Object invoke(MethodSignature signature,
Object bean,
Object argumentSource)
throws MethodInvocationException
- Invoke the method on the bean provided. Argument values are pulled from the provided argument source.
- Parameters:
signature
- the definition of the method to invoke, including the method name and the method argument typesbean
- the bean to invokeargumentSource
- the source for method arguments
- Returns:
- the invoked method's return value
- Throws:
MethodInvocationException
- the method could not be invoked