Class MethodManagedFunctionBuilder
- java.lang.Object
-
- net.officefloor.plugin.managedfunction.clazz.MethodManagedFunctionBuilder
-
- Direct Known Subclasses:
SectionClassManagedFunctionSource.SectionMethodManagedFunctionBuilder
public class MethodManagedFunctionBuilder extends java.lang.Object
Builder to takeMethod
to produce aManagedFunction
.- Author:
- Daniel Sagenschneider
-
-
Nested Class Summary
-
Constructor Summary
Constructors Constructor Description MethodManagedFunctionBuilder()
Initiate.
-
Method Summary
-
-
-
Method Detail
-
loadParameterManufacturers
protected void loadParameterManufacturers(java.util.List<MethodManagedFunctionBuilder.ParameterManufacturer> manufacturers)
Override to add additionalMethodManagedFunctionBuilder.ParameterManufacturer
instances.- Parameters:
manufacturers
- List ofMethodManagedFunctionBuilder.ParameterManufacturer
instances to use.
-
createManagedFunctionFactory
protected ManagedFunctionFactory<Indexed,Indexed> createManagedFunctionFactory(MethodManagedFunctionBuilder.MethodManagedFunctionFactoryContext context) throws java.lang.Exception
Allows overriding the creation of theManagedFunctionFactory
.- Parameters:
context
-MethodManagedFunctionBuilder.MethodManagedFunctionFactoryContext
.- Returns:
ManagedFunctionFactory
.- 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, java.lang.Class<?> instanceClass, MethodManagedFunctionBuilder.MethodObjectInstanceManufacturer methodObjectInstanceManufacturer, FunctionNamespaceBuilder namespaceBuilder, ManagedFunctionSourceContext context) throws java.lang.Exception
Builds theManagedFunction
.- Parameters:
method
-Method
for theManagedFunction
.instanceClass
-Class
instance containing theMethod
.methodObjectInstanceManufacturer
-MethodManagedFunctionBuilder.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
.
-
extractVariableType
protected static java.lang.String extractVariableType(java.lang.reflect.Type variableGenericType)
Extracts the type from the variable.- Parameters:
variableGenericType
- VariableType
.- Returns:
- Variable type.
-
-