Example usage for org.springframework.http MediaType asMediaTypes

List of usage examples for org.springframework.http MediaType asMediaTypes

Introduction

In this page you can find the example usage for org.springframework.http MediaType asMediaTypes.

Prototype

public static List<MediaType> asMediaTypes(List<MimeType> mimeTypes) 

Source Link

Document

Re-create the given mime types as media types.

Usage

From source file:org.springframework.http.codec.DecoderHttpMessageReader.java

/**
 * Create an instance wrapping the given {@link Decoder}.
 *//*w ww. j  ava 2s.  c  o  m*/
public DecoderHttpMessageReader(Decoder<T> decoder) {
    Assert.notNull(decoder, "Decoder is required");
    this.decoder = decoder;
    this.mediaTypes = MediaType.asMediaTypes(decoder.getDecodableMimeTypes());
    initLogger(decoder);
}

From source file:org.springframework.http.codec.EncoderHttpMessageWriter.java

/**
 * Create an instance wrapping the given {@link Encoder}.
 *//* w ww. j a  va 2s.c o m*/
public EncoderHttpMessageWriter(Encoder<T> encoder) {
    Assert.notNull(encoder, "Encoder is required");
    this.encoder = encoder;
    this.mediaTypes = MediaType.asMediaTypes(encoder.getEncodableMimeTypes());
    this.defaultMediaType = initDefaultMediaType(this.mediaTypes);
    initLogger(encoder);
}

From source file:org.springframework.http.codec.ResourceHttpMessageWriter.java

public ResourceHttpMessageWriter(int bufferSize) {
    this.encoder = new ResourceEncoder(bufferSize);
    this.regionEncoder = new ResourceRegionEncoder(bufferSize);
    this.mediaTypes = MediaType.asMediaTypes(this.encoder.getEncodableMimeTypes());
}