Class MethodManagedFunctionBuilder
- java.lang.Object
-
- net.officefloor.plugin.managedfunction.method.MethodManagedFunctionBuilder
-
- Direct Known Subclasses:
SectionClassManagedFunctionSource.SectionMethodManagedFunctionBuilder
public class MethodManagedFunctionBuilder extends java.lang.Object
Builder to wrap execution of aMethod
with aManagedFunction
.- Author:
- Daniel Sagenschneider
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
MethodManagedFunctionBuilder.EnrichManagedFunctionTypeContext
Context for creating theManagedFunctionTypeBuilder
.static class
MethodManagedFunctionBuilder.MethodContext
Useful details regarding theMethod
.static class
MethodManagedFunctionBuilder.MethodManagedFunctionFactoryContext
Context for creating theManagedFunctionFactory
.static class
MethodManagedFunctionBuilder.MethodManagedFunctionTypeContext
Context for creating theManagedFunctionTypeBuilder
.
-
Constructor Summary
Constructors Constructor Description MethodManagedFunctionBuilder()
-
Method Summary
-
-
-
Method Detail
-
createManagedFunctionFactory
protected MethodFunctionFactory createManagedFunctionFactory(MethodManagedFunctionBuilder.MethodManagedFunctionFactoryContext context) throws java.lang.Exception
Allows overriding the creation of theManagedFunctionFactory
.- Parameters:
context
-MethodManagedFunctionBuilder.MethodManagedFunctionFactoryContext
.- Returns:
MethodFunctionFactory
.- Throws:
java.lang.Exception
- If fails to createManagedFunctionFactory
.
-
addManagedFunctionType
protected ManagedFunctionTypeBuilder<Indexed,Indexed> addManagedFunctionType(MethodManagedFunctionBuilder.MethodManagedFunctionTypeContext context) throws java.lang.Exception
Allows overriding the addition of theManagedFunctionTypeBuilder
.- Parameters:
context
-MethodManagedFunctionBuilder.MethodManagedFunctionFactoryContext
.- Returns:
- Added
ManagedFunctionTypeBuilder
. - Throws:
java.lang.Exception
- If fails to createManagedFunctionTypeBuilder
.
-
enrichManagedFunctionType
protected void enrichManagedFunctionType(MethodManagedFunctionBuilder.EnrichManagedFunctionTypeContext context)
Enriches theManagedFunctionTypeBuilder
.- Parameters:
context
-MethodManagedFunctionBuilder.EnrichManagedFunctionTypeContext
.
-
enrichManagedFunctionObjectType
protected void enrichManagedFunctionObjectType(java.lang.Class<?> objectType, java.lang.reflect.Type genericType, java.lang.annotation.Annotation[] annotations, ManagedFunctionObjectTypeBuilder<Indexed> functionObjectType)
Enriches theManagedFunctionObjectTypeBuilder
.- Parameters:
objectType
- Object type.genericType
- Generic type.annotations
-Annotation
instances.functionObjectType
-ManagedFunctionObjectTypeBuilder
.
-
isCandidateFunctionMethod
public boolean isCandidateFunctionMethod(java.lang.reflect.Method method)
Indicates if candidateMethod
forManagedFunction
.- Parameters:
method
-Method
.- Returns:
true
if candidateMethod
forManagedFunction
.
-
buildMethod
public ManagedFunctionTypeBuilder<Indexed,Indexed> buildMethod(java.lang.reflect.Method method, MethodObjectInstanceManufacturer methodObjectInstanceManufacturer, FunctionNamespaceBuilder namespaceBuilder, ManagedFunctionSourceContext context) throws java.lang.Exception
Builds theManagedFunction
.- Parameters:
method
-Method
for theManagedFunction
.methodObjectInstanceManufacturer
-MethodObjectInstanceManufacturer
.namespaceBuilder
-FunctionNamespaceBuilder
.context
-ManagedFunctionSourceContext
.- Returns:
ManagedFunctionTypeBuilder
for theMethod
ornull
if can not to be aManagedFunction
.- Throws:
java.lang.Exception
- If fails to create theManagedFunction
from theMethod
.
-
-