Package io.micronaut.function.web
Class AnnotatedFunctionRouteBuilder
java.lang.Object
io.micronaut.web.router.DefaultRouteBuilder
io.micronaut.function.web.AnnotatedFunctionRouteBuilder
- All Implemented Interfaces:
- AnnotationProcessor<FunctionBean,,- ExecutableMethod<?, - ?>> - ExecutableMethodProcessor<FunctionBean>,- LocalFunctionRegistry,- MediaTypeCodecRegistry,- RouteBuilder
@Singleton
@Replaces(DefaultLocalFunctionRegistry.class)
public class AnnotatedFunctionRouteBuilder
extends DefaultRouteBuilder
implements ExecutableMethodProcessor<FunctionBean>, LocalFunctionRegistry, MediaTypeCodecRegistry
Process methods for 
FunctionBean instances.- Since:
- 1.0
- Author:
- Graeme Rocher
- 
Nested Class SummaryNested classes/interfaces inherited from interface io.micronaut.web.router.RouteBuilderRouteBuilder.UriNamingStrategy
- 
Field SummaryFields inherited from class io.micronaut.web.router.DefaultRouteBuilderCAMEL_CASE_NAMING_STRATEGY, conversionService, defaultCharset, executionHandleLocator, LOG, uriNamingStrategyFields inherited from interface io.micronaut.function.LocalFunctionRegistryFUNCTION_CHARSET, FUNCTION_NAME, FUNCTION_PREFIXFields inherited from interface io.micronaut.web.router.RouteBuilderID
- 
Constructor SummaryConstructorsConstructorDescriptionAnnotatedFunctionRouteBuilder(ExecutionHandleLocator executionHandleLocator, RouteBuilder.UriNamingStrategy uriNamingStrategy, ConversionService conversionService, MediaTypeCodecRegistry codecRegistry, String contextPath) Constructor.
- 
Method SummaryModifier and TypeMethodDescription<T,R> Optional<? extends ExecutableMethod<T, R>> Find the first available registered function.<T,U, R> Optional<ExecutableMethod<BiFunction<T, U, R>, R>> findBiFunction(String name) Find aBiFunctionfor the given name.Find a codec for the given media type.Find a codec for the given media type and target type.<T> Optional<ExecutableMethod<Consumer<T>,Void>> findConsumer(String name) Find aConsumerfor the given name.<T,R> Optional<? extends ExecutableMethod<T, R>> Find the first available registered function.<T,R> Optional<ExecutableMethod<Function<T, R>, R>> findFunction(String name) Find aFunctionfor the given name.<T> Optional<ExecutableMethod<Supplier<T>,T>> findSupplier(String name) Find aSupplierfor the given name.A map of available functions with the key being the function name and the value being the function URI.voidprocess(BeanDefinition<?> beanDefinition, ExecutableMethod<?, ?> method) The process method will be called for everyExecutableMethodthat is annotated with the type parameter A.Methods inherited from class io.micronaut.web.router.DefaultRouteBuilderaddFilter, buildBeanRoute, buildRoute, buildRoute, buildRoute, DELETE, DELETE, DELETE, error, error, GET, GET, GET, getErrorRoutes, getExposedPorts, getFilterRoutes, getStatusRoutes, getUriNamingStrategy, getUriRoutes, HEAD, HEAD, HEAD, OPTIONS, OPTIONS, OPTIONS, PATCH, PATCH, PATCH, POST, POST, POST, PUT, PUT, PUT, resources, single, status, status, TRACE, TRACE, TRACEMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.micronaut.web.router.RouteBuilderDELETE, DELETE, DELETE, DELETE, DELETE, DELETE, error, error, error, error, GET, GET, GET, GET, GET, GET, HEAD, HEAD, HEAD, HEAD, HEAD, HEAD, OPTIONS, OPTIONS, OPTIONS, OPTIONS, OPTIONS, OPTIONS, PATCH, PATCH, PATCH, PATCH, PATCH, PATCH, POST, POST, POST, POST, POST, POST, PUT, PUT, PUT, PUT, PUT, PUT, resources, single, status, TRACE, TRACE, TRACE, TRACE, TRACE, TRACE
- 
Constructor Details- 
AnnotatedFunctionRouteBuilderpublic AnnotatedFunctionRouteBuilder(ExecutionHandleLocator executionHandleLocator, RouteBuilder.UriNamingStrategy uriNamingStrategy, ConversionService conversionService, MediaTypeCodecRegistry codecRegistry, @Value("${micronaut.function.context-path:/}") String contextPath) Constructor.- Parameters:
- executionHandleLocator- executionHandleLocator
- uriNamingStrategy- uriNamingStrategy
- conversionService- conversionService
- codecRegistry- codecRegistry
- contextPath- contextPath
 
 
- 
- 
Method Details- 
processDescription copied from interface:ExecutableMethodProcessorThe process method will be called for everyExecutableMethodthat is annotated with the type parameter A.- Specified by:
- processin interface- AnnotationProcessor<FunctionBean,- ExecutableMethod<?, - ?>> 
- Specified by:
- processin interface- ExecutableMethodProcessor<FunctionBean>
- Parameters:
- beanDefinition- The bean definition to process
- method- The executable method
 
- 
getAvailableFunctionsA map of available functions with the key being the function name and the value being the function URI.- Specified by:
- getAvailableFunctionsin interface- LocalFunctionRegistry
- Returns:
- A map of functions
 
- 
findFirstDescription copied from interface:LocalFunctionRegistryFind the first available registered function.- Specified by:
- findFirstin interface- LocalFunctionRegistry
- Type Parameters:
- T- The declaring type
- R- The result of the method call
- Returns:
- The ExecutableMethodmethod representing the function
 
- 
findDescription copied from interface:LocalFunctionRegistryFind the first available registered function.- Specified by:
- findin interface- LocalFunctionRegistry
- Type Parameters:
- T- The declaring type
- R- The result of the method call
- Parameters:
- name- the name
- Returns:
- The ExecutableMethodmethod representing the function
 
- 
findSupplierDescription copied from interface:LocalFunctionRegistryFind aSupplierfor the given name.- Specified by:
- findSupplierin interface- LocalFunctionRegistry
- Type Parameters:
- T- The type
- Parameters:
- name- The name
- Returns:
- An Optionalof aSupplier
 
- 
findConsumerDescription copied from interface:LocalFunctionRegistryFind aConsumerfor the given name.- Specified by:
- findConsumerin interface- LocalFunctionRegistry
- Type Parameters:
- T- The type
- Parameters:
- name- The name
- Returns:
- An Optionalof aConsumer
 
- 
findFunctionDescription copied from interface:LocalFunctionRegistryFind aFunctionfor the given name.- Specified by:
- findFunctionin interface- LocalFunctionRegistry
- Type Parameters:
- T- The type
- R- The result of the method call
- Parameters:
- name- The name
- Returns:
- An Optionalof aFunction
 
- 
findBiFunctionDescription copied from interface:LocalFunctionRegistryFind aBiFunctionfor the given name.- Specified by:
- findBiFunctionin interface- LocalFunctionRegistry
- Type Parameters:
- T- The type
- U- the type of the second argument to the function
- R- The result of the method call
- Parameters:
- name- The name
- Returns:
- An Optionalof aBiFunction
 
- 
findCodecDescription copied from interface:MediaTypeCodecRegistryFind a codec for the given media type.- Specified by:
- findCodecin interface- MediaTypeCodecRegistry
- Parameters:
- mediaType- The- MediaType
- Returns:
- The codec
 
- 
findCodecDescription copied from interface:MediaTypeCodecRegistryFind a codec for the given media type and target type.- Specified by:
- findCodecin interface- MediaTypeCodecRegistry
- Parameters:
- mediaType- The- MediaType
- type- The type
- Returns:
- The codec
 
- 
getCodecs- Specified by:
- getCodecsin interface- MediaTypeCodecRegistry
- Returns:
- The available codecs
 
 
-