Spring Framework ConversionServiceFactoryBean - 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 ConversionServiceFactoryBean class.

This code example shows how to use the following methods:setConverters
		return sparklrService;
	} 
 
	@Bean 
	public ConversionServiceFactoryBean conversionService() {
		ConversionServiceFactoryBean conversionService = new ConversionServiceFactoryBean();
		conversionService.setConverters(Collections.singleton(new AccessTokenRequestConverter()));
		return conversionService;
	} 
 
	public void addResourceHandlers(ResourceHandlerRegistry registry) {
		registry.addResourceHandler("/resources/**").addResourceLocations("/resources/");
	} 
 
	@Override 
	public void configureMessageConverters(List<HttpMessageConverter<?>> converters) {
		converters.add(new BufferedImageHttpMessageConverter());
	} 
 
	@Configuration 
5
CodeRank
This code example shows how to use the following methods:
 * 
 * @author Oleg Zhurakousky 
 * @author Mark Fisher 
 * @since 2.0 
 */ 
class CustomConversionServiceFactoryBean extends ConversionServiceFactoryBean {
 
	@Override 
	public ConversionService getObject() {
		ConversionService service = super.getObject();
		if (service instanceof GenericConversionService) {
			((GenericConversionService) service).removeConvertible(Object.class, Object.class);
		} 
		return service;
	} 
 
} 
5
CodeRank
This code example shows how to use the following methods:
/** 
 *  
 * @author Rostislav Hristov 
 * 
 */ 
public class ConversionDiscoveryFactoryBean extends ConversionServiceFactoryBean {
 
	@SuppressWarnings("rawtypes") 
	private Map<String, Converter> cachedConverters;
 
	@SuppressWarnings("rawtypes") 
	public ConversionService getObject() {
		ConversionService conversionService = super.getObject();
		if (conversionService instanceof ConverterRegistry) {
			ConverterRegistry registry = (ConverterRegistry) conversionService;
			if (cachedConverters == null) {
				cachedConverters = BeanUtils.getBeansOfType(Converter.class);
				ConversionServiceFactory.registerConverters(new LinkedHashSet<Converter>(cachedConverters.values()),
						registry);
			} 
5
CodeRank
This code example shows how to use the following methods:
 
 
	/** 
	 * This is a workaround until we depend on Spring 3.1 and specifically when SPR-8818 is resolved. 
	 */ 
	static class CustomConversionServiceFactoryBean extends ConversionServiceFactoryBean {
 
		@Override 
		public ConversionService getObject() {
			ConversionService service = super.getObject();
			if (service instanceof GenericConversionService) {
				((GenericConversionService) service).removeConvertible(Object.class, Object.class);
			} 
			return service;
		} 
	} 
 
} 
4
CodeRank
See Code Examples for Spring Framework ConversionServiceFactoryBean Methods: