Package com.linecorp.armeria.server.annotation
@NonNullByDefault
package com.linecorp.armeria.server.annotation
Annotations for building a RESTful service.
-
InterfaceDescriptionDecoratorFactoryFunction<T extends Annotation>A decorator factory which is used for a user-defined decorator annotation.An interface for exception handler.HttpResult<T>An interface which helps a user specify an
HttpStatus
orResponseHeaders
for a response produced by an annotated HTTP service method.Converts anAggregatedHttpRequest
to an object.ARequestConverterFunction
provider interface which creates a newRequestConverterFunction
for converting anAggregatedHttpRequest
to an object of the given type.Converts aresult
object toHttpResponse
.AResponseConverterFunction
provider interface which creates a newResponseConverterFunction
for converting an object of the given type and functions. -
ClassDescriptionA
RequestConverterFunction
which converts a binary body of theAggregatedHttpRequest
to one ofbyte[]
orHttpData
depending on theexpectedResultType
.AResponseConverterFunction
which creates anHttpResponse
when: theresult
is an instance ofHttpData
orbyte[]
theresult
is an instance ofPublisher
orStream
while the"content-type"
of theResponseHeaders
is"application/binary"
or"application/octet-stream"
Note that thisResponseConverterFunction
is applied to an annotated service by default, so you don't have to specify this converter explicitly.A response converter implementation which creates anHttpResponse
when theresult
is an instance ofHttpFile
.ARequestConverterFunction
which converts a JSON body of theAggregatedHttpRequest
to an object using the defaultObjectMapper
.A response converter implementation which creates anHttpResponse
withcontent-type: application/json; charset=utf-8
orcontent-type: application/json-seq
.A response converter implementation which creates anHttpResponse
ofHttpStatus.NO_CONTENT
when the specifiedresult
isnull
.A response converter implementation which creates anHttpResponse
withcontent-type: text/event-stream
.AResponseConverterFunction
which creates anHttpResponse
when: theresult
is an instance ofCharSequence
the"content-type"
of theResponseHeaders
isMediaType.ANY_TEXT_TYPE
Note that thisResponseConverterFunction
is applied to an annotated service by default, so you don't have to specify this converter explicitly. -
Annotation InterfaceDescriptionAnnotation for an additional HTTP header.The containing annotation type for
AdditionalHeader
.Annotation for an additional HTTP trailer.The containing annotation type forAdditionalTrailer
.Specifies that the annotated service method must be invoked from the blocking task executor instead of an event loop thread.Specifies a media type which would be consumed by the service method or class.An alias for@Consumes(MediaTypeNames.APPLICATION_BINARY)
.The containing annotation type forConsumes
.An alias for@Consumes(MediaTypeNames.JSON)
.An alias for@Consumes(MediaTypeNames.OCTET_STREAM)
.An alias for@Consumes(MediaTypeNames.PROTOBUF)
.An alias for@Consumes(MediaTypeNames.PLAIN_TEXT_UTF_8)
.Specifies aDecoratingHttpServiceFunction
class which handles anHttpRequest
before invoking an annotated service method.Specifies aDecoratorFactoryFunction
class which is a factory to create a decorator.The containing annotation type forDecorator
.Specifies the default value of an optional parameter.Annotation for mappingHttpMethod.DELETE
onto specific method.An annotation used in annotated HTTP service.Specifies anExceptionHandlerFunction
class which handles exceptions throwing from an annotated service method.The containing annotation type forExceptionHandler
.Annotation for mappingHttpMethod.GET
onto specific method.Annotation for mappingHttpMethod.HEAD
onto specific method.Annotation for mapping an HTTP request header onto the following elements.Specifies a predicate which evaluates whether a request can be accepted by a service method.The containing annotation type forMatchesHeader
.Specifies a predicate which evaluates whether a request can be accepted by a service method.The containing annotation type forMatchesParam
.Annotation for mappingHttpMethod.OPTIONS
onto specific method.Specifies an order which is used to sort the annotated service methods.Annotation for mapping a parameter of a request onto the following elements.Annotation for mappingHttpMethod.PATCH
onto specific method.Annotation for mapping dynamic web requests onto specific method.Annotation that can be used on a class as a path prefix for all the methods that handle http request.The containing annotation type forPath
.Annotation for mappingHttpMethod.POST
onto specific method.Specifies a media type which would be produced by the service method or class.An alias for@Produces(MediaTypeNames.APPLICATION_BINARY)
.An alias for@Produces(MediaTypeNames.EVENT_STREAM)
and@ResponseConverter(ServerSentEventResponseConverterFunction.class)
.The containing annotation type forProduces
.An alias for@Produces(MediaTypeNames.JSON_UTF_8)
.An alias for@Produces(MediaTypeNames.JSON_SEQ)
.An alias for@Produces(MediaTypeNames.OCTET_STREAM)
.An alias for@Produces(MediaTypeNames.PROTOBUF)
.An alias for@Produces(MediaTypeNames.PLAIN_TEXT_UTF_8)
.Annotation for mappingHttpMethod.PUT
onto specific method.Specifies aRequestConverterFunction
class which converts anAggregatedHttpRequest
to an object.The containing annotation type forRequestConverter
.Specifies which element should be converted byRequestConverterFunction
.Specifies aResponseConverterFunction
class which converts the result toHttpResponse
.The containing annotation type forResponseConverter
.Annotation for service name that is often used as a meter tag or distributed trace's span name.An annotation which specifies a default HTTP status code of a response produced by an annotated HTTP service.Annotation for mappingHttpMethod.TRACE
onto specific method.
LoggingService
or log exceptions usingServerBuilder.errorHandler(ServerErrorHandler)
instead.