Annotation Interface PartParam


@Documented @Retention(SOURCE) @Target(PARAMETER) public @interface PartParam

Binds a Web route method parameter to a body part.

The name of the body part is the method parameter name by default and it can be overridden by specifying the name() attribute.

The type of the annotated parameter can either be:

  • ByteBuf, Mono<ByteBuf>, Flux<ByteBuf> or Publisher<ByteBuf> to produce raw data
  • String, Mono<String>, Flux<String> or Publisher<String> to produce string data
  • T, Mono<T>, Flux<T> or Publisher<T> to produce data encoded based on the part content type specified in the contentType() attribute.
  • Resource to produce resource data, the part filename is then set to the resource file name by default, this can be overridden by specifying the filename() attribute.

An encoded part payload is decoded encoded using one of the MediaTypeConverter injected in the Web client module and corresponding to the part content type.

Since:
1.12
Author:
Jeremy Kuhn
See Also:
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    Specifies the content type of the body part.
    Specifies the body part file name.
    Specifies the name of the body part.
  • Element Details

    • name

      String name

      Specifies the name of the body part.

      Returns:
      the part name
      Default:
      ""
    • filename

      String filename

      Specifies the body part file name.

      Returns:
      the part file name
      Default:
      ""
    • contentType

      String contentType

      Specifies the content type of the body part.

      Returns:
      the part content type
      Default:
      ""