Spring Framework ResourceHttpMessageConverter - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Spring Framework ResourceHttpMessageConverter class.

This code example shows how to use the following methods:
This code example shows how to use the following methods:
This code example shows how to use the following methods:
		return OAuth2Version.BEARER; 
	} 
 
	/** 
	 * Subclassing hook to enable customization of the RestTemplate used to consume provider API resources. 
	 * An example use case might be to configure a custom error handler. 
	 * Note that this method is called after the RestTemplate has been configured with the message converters returned from getMessageConverters(). 
	 * @param restTemplate the RestTemplate to configure. 
	 */ 
	protected void configureRestTemplate(RestTemplate restTemplate) {
	} 
 
	/** 
	 * Returns a list of {@link HttpMessageConverter}s to be used by the internal {@link RestTemplate}. 
	 * By default, this includes a {@link StringHttpMessageConverter}, a {@link MappingJackson2HttpMessageConverter}, a {@link ByteArrayHttpMessageConverter}, and a {@link FormHttpMessageConverter}. 
	 * The {@link FormHttpMessageConverter} is set to use "UTF-8" character encoding. 
	 * Override this method to add additional message converters or to replace the default list of message converters. 
	 */ 
	protected List<HttpMessageConverter<?>> getMessageConverters() {
		List<HttpMessageConverter<?>> messageConverters = new ArrayList<HttpMessageConverter<?>>();
4
CodeRank
This code example shows how to use the following methods:
	 
	/** 
	 * Returns a list of {@link HttpMessageConverter}s to be used by the internal {@link RestTemplate}. 
	 * By default, this includes a {@link StringHttpMessageConverter}, a {@link MappingJackson2HttpMessageConverter}, a {@link ByteArrayHttpMessageConverter}, and a {@link FormHttpMessageConverter}. 
	 * The {@link FormHttpMessageConverter} is set to use "UTF-8" character encoding. 
	 * Override this method to add additional message converters or to replace the default list of message converters. 
	 */ 
	protected List<HttpMessageConverter<?>> getMessageConverters() {
		List<HttpMessageConverter<?>> messageConverters = new ArrayList<HttpMessageConverter<?>>();
		messageConverters.add(new StringHttpMessageConverter());
		messageConverters.add(getFormMessageConverter());
		messageConverters.add(getJsonMessageConverter());
		messageConverters.add(getByteArrayMessageConverter());
		return messageConverters;
	} 
	 
	/** 
	 * Returns an {@link FormHttpMessageConverter} to be used by the internal {@link RestTemplate}. 
	 * By default, the message converter is set to use "UTF-8" character encoding. 
	 * Override to customize the message converter (for example, to set supported media types or message converters for the parts of a multipart message).  
4
CodeRank
This code example shows how to use the following methods:
 
	private List<HttpMessageConverter<?>> getHttpMessageConverters() {
		List<HttpMessageConverter<?>> messageConverters = new ArrayList<HttpMessageConverter<?>>();
		messageConverters.add(new ByteArrayHttpMessageConverter());
		messageConverters.add(new StringHttpMessageConverter());
		messageConverters.add(new ResourceHttpMessageConverter());
		messageConverters.add(new UploadApplicationPayloadHttpMessageConverter());
		messageConverters.add(getFormHttpMessageConverter());
		messageConverters.add(new MappingJacksonHttpMessageConverter());
		messageConverters.add(new LoggregatorHttpMessageConverter());
		return messageConverters;
	} 
 
	private FormHttpMessageConverter getFormHttpMessageConverter() {
		FormHttpMessageConverter formPartsMessageConverter = new CloudFoundryFormHttpMessageConverter();
		formPartsMessageConverter.setPartConverters(getFormPartsMessageConverters());
		return formPartsMessageConverter;
	} 
 
	private List<HttpMessageConverter<?>> getFormPartsMessageConverters() {
3
CodeRank
This code example shows how to use the following methods:
        StringHttpMessageConverter stringConverter = new StringHttpMessageConverter(Charset.forName("UTF-8")); 
        stringConverter.setWriteAcceptCharset(false); // See SPR-7316 
 
        converters.add(new ByteArrayHttpMessageConverter()); 
        converters.add(stringConverter); 
        converters.add(new ResourceHttpMessageConverter()); 
 
        if (isJaxb2Present()) { 
            converters.add(new Jaxb2RootElementHttpMessageConverter()); 
        } 
        if (isJackson2Present()) { 
            converters.add(new MappingJackson2HttpMessageConverter()); 
 
        } else if (isJacksonPresent()) { 
            converters.add(new MappingJacksonHttpMessageConverter()); 
        } 
        return converters; 
    } 
} 
4
CodeRank