Package com.linecorp.armeria.server.annotation
@NonNullByDefault
package com.linecorp.armeria.server.annotation
Annotations for building a RESTful service.
-
ClassDescriptionAnnotation 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.ARequestConverterFunction
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.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.DecoratorFactoryFunction<T extends Annotation>A decorator factory which is used for a user-defined decorator annotation.The containing annotation type forDecorator
.Specifies the default value of an optional parameter.AResponseConverterFunction
provider interface which provides aResponseConverterFunction
that converts an object of the given type to anHttpResponse
using the delegatingResponseConverterFunction
.Annotation for mappingHttpMethod.DELETE
onto specific method.Specifies a delimiter of a parameter.An annotation used in annotated HTTP service.Specifies anExceptionHandlerFunction
class which handles exceptions throwing from an annotated service method.An interface for exception handler.The containing annotation type forExceptionHandler
.Deprecated.ARuntimeException
raised for falling through to the next something.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.A response converter implementation which creates anHttpResponse
when theresult
is an instance ofHttpFile
.HttpResult<T>An interface which helps a user specify anHttpStatus
orResponseHeaders
for a response produced by an annotated HTTP service method.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
.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
.A response converter implementation which creates anHttpResponse
ofHttpStatus.NO_CONTENT
when the specifiedresult
isnull
.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.Converts anAggregatedHttpRequest
to an object.ARequestConverterFunction
provider interface which creates a newRequestConverterFunction
for converting anAggregatedHttpRequest
to an object of the given type.The containing annotation type forRequestConverter
.Specifies which element should be converted byRequestConverterFunction
.Specifies aResponseConverterFunction
class which converts the result toHttpResponse
.Converts aresult
object toHttpResponse
.AResponseConverterFunction
provider interface which creates a newResponseConverterFunction
for converting an object of the given type and functions.The containing annotation type forResponseConverter
.A response converter implementation which creates anHttpResponse
withcontent-type: text/event-stream
.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.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 for mappingHttpMethod.TRACE
onto specific method.
LoggingService
or log exceptions usingServerBuilder.errorHandler(ServerErrorHandler)
instead.