Package net.officefloor.frame.test
Class ReflectiveFunctionBuilder
java.lang.Object
net.officefloor.frame.api.function.StaticManagedFunction<Indexed,Indexed>
net.officefloor.frame.test.ReflectiveFunctionBuilder
- All Implemented Interfaces:
ManagedFunction<Indexed,,Indexed> ManagedFunctionFactory<Indexed,Indexed>
Reflective
ManagedFunctionBuilder.- Author:
- Daniel Sagenschneider
-
Constructor Summary
ConstructorsConstructorDescriptionReflectiveFunctionBuilder(Class<C> clazz, C object, String methodName, OfficeBuilder officeBuilder, ConstructTestSupport constructTestSupport) Initiate. -
Method Summary
Modifier and TypeMethodDescriptionvoidBuildsAsynchronousFlow.voidBuilds the flow.voidBuilds theManagedFunctionContext.voidbuildObject(String scopeManagedObjectName) Links theManagedObjectto theManagedFunction.buildObject(String officeManagedObjectName, ManagedObjectScope managedObjectScope) Builds theManagedObjectScopeboundManagedObject.voidBuilds the parameter.voidexecute(ManagedFunctionContext<Indexed, Indexed> context) Executes the function.Obtains theManagedFunctionBuilder.postAdminister(String methodName) Creates postAdministration.preAdminister(String methodName) Creates preAdministration.voidsetNextFunction(String functionName) Specifies the nextManagedFunctionusing the return type of theMethodas the argument type.Methods inherited from class net.officefloor.frame.api.function.StaticManagedFunction
createManagedFunction
-
Constructor Details
-
ReflectiveFunctionBuilder
public ReflectiveFunctionBuilder(Class<C> clazz, C object, String methodName, OfficeBuilder officeBuilder, ConstructTestSupport constructTestSupport) Initiate.- Type Parameters:
C-ManagedFunctionMethodcontainingClasstype.- Parameters:
clazz-Class.object- Object should the method not bestatic. May benullifstaticMethodof theClass.methodName- Name of theMethodto invoke.officeBuilder-OfficeBuilder.constructTestSupport-ConstructTestSupport.
-
-
Method Details
-
getBuilder
Obtains theManagedFunctionBuilder.- Returns:
ManagedFunctionBuilder.
-
buildManagedFunctionContext
public void buildManagedFunctionContext()Builds theManagedFunctionContext. -
buildParameter
public void buildParameter()Builds the parameter. -
buildAsynchronousFlow
public void buildAsynchronousFlow()BuildsAsynchronousFlow. -
buildObject
Links theManagedObjectto theManagedFunction.- Parameters:
scopeManagedObjectName- Scope name of theManagedObject.
-
buildObject
public DependencyMappingBuilder buildObject(String officeManagedObjectName, ManagedObjectScope managedObjectScope) Builds theManagedObjectScopeboundManagedObject.- Parameters:
officeManagedObjectName-Officename of theManagedObject.managedObjectScope-ManagedObjectScopefor theManagedObject.- Returns:
DependencyMappingBuilder.
-
buildFlow
Builds the flow.- Parameters:
functionName-ManagedFunctionname.argumentType- Type of argument passed to theFlow.isSpawnThreadState-trueto spawn inThreadState.
-
setNextFunction
Specifies the nextManagedFunctionusing the return type of theMethodas the argument type.- Parameters:
functionName-ManagedFunctionname.
-
preAdminister
Creates preAdministration.- Parameters:
methodName- Name ofMethodforAdministration.- Returns:
ReflectiveAdministrationBuilder.
-
postAdminister
Creates postAdministration.- Parameters:
methodName- Name ofMethodforAdministration.- Returns:
ReflectiveAdministrationBuilder.
-
execute
Description copied from interface:ManagedFunctionExecutes the function.- Parameters:
context-ManagedFunctionContextfor theManagedFunction.- Throws:
Throwable- Indicating failure of theManagedFunction.
-