Example usage for org.springframework.web.reactive HandlerMapping PRODUCIBLE_MEDIA_TYPES_ATTRIBUTE

List of usage examples for org.springframework.web.reactive HandlerMapping PRODUCIBLE_MEDIA_TYPES_ATTRIBUTE

Introduction

In this page you can find the example usage for org.springframework.web.reactive HandlerMapping PRODUCIBLE_MEDIA_TYPES_ATTRIBUTE.

Prototype

String PRODUCIBLE_MEDIA_TYPES_ATTRIBUTE

To view the source code for org.springframework.web.reactive HandlerMapping PRODUCIBLE_MEDIA_TYPES_ATTRIBUTE.

Click Source Link

Document

Name of the ServerWebExchange#getAttributes() attribute containing the set of producible MediaType's applicable to the mapped handler.

Usage

From source file:org.springframework.web.reactive.result.HandlerResultHandlerSupport.java

@SuppressWarnings("unchecked")
private List<MediaType> getProducibleTypes(ServerWebExchange exchange,
        Supplier<List<MediaType>> producibleTypesSupplier) {

    Set<MediaType> mediaTypes = exchange.getAttribute(HandlerMapping.PRODUCIBLE_MEDIA_TYPES_ATTRIBUTE);
    return (mediaTypes != null ? new ArrayList<>(mediaTypes) : producibleTypesSupplier.get());
}