Java Code Examples for org.springframework.http.MediaType#asMediaTypes()

The following examples show how to use org.springframework.http.MediaType#asMediaTypes() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: DecoderHttpMessageReader.java    From spring-analysis-note with MIT License 5 votes vote down vote up
/**
 * Create an instance wrapping the given {@link Decoder}.
 */
public DecoderHttpMessageReader(Decoder<T> decoder) {
	Assert.notNull(decoder, "Decoder is required");
	initLogger(decoder);
	this.decoder = decoder;
	this.mediaTypes = MediaType.asMediaTypes(decoder.getDecodableMimeTypes());
}
 
Example 2
Source File: EncoderHttpMessageWriter.java    From spring-analysis-note with MIT License 5 votes vote down vote up
/**
 * Create an instance wrapping the given {@link Encoder}.
 */
public EncoderHttpMessageWriter(Encoder<T> encoder) {
	Assert.notNull(encoder, "Encoder is required");
	initLogger(encoder);
	this.encoder = encoder;
	this.mediaTypes = MediaType.asMediaTypes(encoder.getEncodableMimeTypes());
	this.defaultMediaType = initDefaultMediaType(this.mediaTypes);
}
 
Example 3
Source File: DecoderHttpMessageReader.java    From java-technology-stack with MIT License 5 votes vote down vote up
/**
 * Create an instance wrapping the given {@link Decoder}.
 */
public DecoderHttpMessageReader(Decoder<T> decoder) {
	Assert.notNull(decoder, "Decoder is required");
	initLogger(decoder);
	this.decoder = decoder;
	this.mediaTypes = MediaType.asMediaTypes(decoder.getDecodableMimeTypes());
}
 
Example 4
Source File: EncoderHttpMessageWriter.java    From java-technology-stack with MIT License 5 votes vote down vote up
/**
 * Create an instance wrapping the given {@link Encoder}.
 */
public EncoderHttpMessageWriter(Encoder<T> encoder) {
	Assert.notNull(encoder, "Encoder is required");
	initLogger(encoder);
	this.encoder = encoder;
	this.mediaTypes = MediaType.asMediaTypes(encoder.getEncodableMimeTypes());
	this.defaultMediaType = initDefaultMediaType(this.mediaTypes);
}
 
Example 5
Source File: ResourceHttpMessageWriter.java    From spring-analysis-note with MIT License 4 votes vote down vote up
public ResourceHttpMessageWriter(int bufferSize) {
	this.encoder = new ResourceEncoder(bufferSize);
	this.regionEncoder = new ResourceRegionEncoder(bufferSize);
	this.mediaTypes = MediaType.asMediaTypes(this.encoder.getEncodableMimeTypes());
}
 
Example 6
Source File: ResourceHttpMessageWriter.java    From java-technology-stack with MIT License 4 votes vote down vote up
public ResourceHttpMessageWriter(int bufferSize) {
	this.encoder = new ResourceEncoder(bufferSize);
	this.regionEncoder = new ResourceRegionEncoder(bufferSize);
	this.mediaTypes = MediaType.asMediaTypes(this.encoder.getEncodableMimeTypes());
}