Class MethodFunction
java.lang.Object
net.officefloor.plugin.clazz.method.MethodFunction
- All Implemented Interfaces:
ManagedFunction<Indexed,Indexed>
ManagedFunction to invoke a Method.- Author:
- Daniel Sagenschneider
-
Constructor Summary
ConstructorsConstructorDescriptionMethodFunction(MethodObjectFactory methodObjectInstanceFactory, Method method, ClassDependencyFactory[] parameterFactories, MethodReturnTranslator<Object, Object> returnTranslator) Initiate. -
Method Summary
Modifier and TypeMethodDescriptionvoidexecute(ManagedFunctionContext<Indexed, Indexed> context) Executes the function.Returns theMethodfor theManagedFunction.static ObjectinvokeMethod(Object instance, Method method, Object[] parameters)
-
Constructor Details
-
MethodFunction
public MethodFunction(MethodObjectFactory methodObjectInstanceFactory, Method method, ClassDependencyFactory[] parameterFactories, MethodReturnTranslator<Object, Object> returnTranslator) Initiate.- Parameters:
methodObjectInstanceFactory-MethodObjectFactory. Will benullif staticMethod.method- Method to invoke for thisManagedFunction.parameterFactories-ClassDependencyFactoryinstances.returnTranslator-MethodReturnTranslatorornull.
-
-
Method Details
-
invokeMethod
-
getMethod
Returns theMethodfor theManagedFunction.- Returns:
Methodfor theManagedFunction.
-
execute
Description copied from interface:ManagedFunctionExecutes the function.- Specified by:
executein interfaceManagedFunction<Indexed,Indexed> - Parameters:
context-ManagedFunctionContextfor theManagedFunction.- Throws:
Throwable- Indicating failure of theManagedFunction.
-