Package io.micronaut.http.body
Class ContextlessMessageBodyHandlerRegistry
java.lang.Object
io.micronaut.http.body.ContextlessMessageBodyHandlerRegistry
- All Implemented Interfaces:
MessageBodyHandlerRegistry
MessageBodyHandlerRegistry implementation that does not need an application context.- Since:
- 4.0.0
- Author:
- Jonas Konrad
-
Field Summary
Fields inherited from interface io.micronaut.http.body.MessageBodyHandlerRegistry
EMPTY -
Constructor Summary
ConstructorsConstructorDescriptionContextlessMessageBodyHandlerRegistry(ApplicationConfiguration applicationConfiguration, ByteBufferFactory<?, ?> byteBufferFactory, TypedMessageBodyHandler<?>... otherRawHandlers) -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(@NonNull MediaType mediaType, @NonNull MessageBodyHandler<?> handler) Add aMessageBodyHandlerfor the given media type.voidadd(@NonNull MediaType mediaType, @NonNull MessageBodyReader<?> handler) Add aMessageBodyReaderfor the given media type.voidadd(@NonNull MediaType mediaType, @NonNull MessageBodyWriter<?> handler) Add aMessageBodyWriterfor the given media type.<T> Optional<MessageBodyReader<T>>findReader(Argument<T> type, List<MediaType> mediaTypes) Find a reader for the type and annotation metadata at declaration point.protected <T> MessageBodyReader<T>findReaderImpl(Argument<T> type, List<MediaType> mediaTypes) <T> Optional<MessageBodyWriter<T>>findWriter(Argument<T> type, List<MediaType> mediaTypes) Find a writer for the type and annotation metadata at declaration point.protected <T> MessageBodyWriter<T>findWriterImpl(Argument<T> type, List<MediaType> mediaTypes) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.micronaut.http.body.MessageBodyHandlerRegistry
findReader, findReader, findWriter, findWriter, getReader, getWriter
-
Constructor Details
-
ContextlessMessageBodyHandlerRegistry
public ContextlessMessageBodyHandlerRegistry(ApplicationConfiguration applicationConfiguration, ByteBufferFactory<?, ?> byteBufferFactory, TypedMessageBodyHandler<?>... otherRawHandlers) - Parameters:
applicationConfiguration- The configurationbyteBufferFactory- The buffer factoryotherRawHandlers- Raw handlers to add on top of the default ones
-
-
Method Details
-
add
public void add(@NonNull @NonNull MediaType mediaType, @NonNull @NonNull MessageBodyHandler<?> handler) Add aMessageBodyHandlerfor the given media type.- Parameters:
mediaType- The media type the handler applies tohandler- The handler
-
add
public void add(@NonNull @NonNull MediaType mediaType, @NonNull @NonNull MessageBodyWriter<?> handler) Add aMessageBodyWriterfor the given media type.- Parameters:
mediaType- The media type the handler applies tohandler- The handler
-
add
public void add(@NonNull @NonNull MediaType mediaType, @NonNull @NonNull MessageBodyReader<?> handler) Add aMessageBodyReaderfor the given media type.- Parameters:
mediaType- The media type the handler applies tohandler- The handler
-
findReaderImpl
-
findWriterImpl
-
findReader
Description copied from interface:MessageBodyHandlerRegistryFind a reader for the type and annotation metadata at declaration point.- Specified by:
findReaderin interfaceMessageBodyHandlerRegistry- Type Parameters:
T- The generic type- Parameters:
type- The typemediaTypes- The media type- Returns:
- A message body reader if it is existing.
-
findWriter
Description copied from interface:MessageBodyHandlerRegistryFind a writer for the type and annotation metadata at declaration point.- Specified by:
findWriterin interfaceMessageBodyHandlerRegistry- Type Parameters:
T- The generic type- Parameters:
type- The typemediaTypes- The media type- Returns:
- A message body writer if it is existing.
-