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

This code example shows how to use the following methods:convert
		this.stringHttpMessageConverter.writeInternal(s, outputMessage);
	} 
 
	@Override 
	protected Long getContentLength(Object obj, MediaType contentType) {
		String value = this.conversionService.convert(obj, String.class);
		return this.stringHttpMessageConverter.getContentLength(value, contentType);
	} 
 
} 
5
CodeRank
This code example shows how to use the following methods:canConvert
		DataBinder binder = binderFactory.createBinder(request, null, attributeName); 
		ConversionService conversionService = binder.getConversionService(); 
		if (conversionService != null) { 
			TypeDescriptor source = TypeDescriptor.valueOf(String.class); 
			TypeDescriptor target = new TypeDescriptor(parameter); 
			if (conversionService.canConvert(source, target)) { 
				return binder.convertIfNecessary(sourceValue, parameter.getParameterType(), parameter); 
			} 
		} 
		return null; 
	} 
 
	/** 
	 * This implementation downcasts {@link WebDataBinder} to 
	 * {@link ServletRequestDataBinder} before binding. 
	 * @see ServletRequestDataBinderFactory 
	 */ 
	@Override 
	protected void bindRequestParameters(WebDataBinder binder, NativeWebRequest request) { 
		ServletRequest servletRequest = request.getNativeRequest(ServletRequest.class); 
5
CodeRank
This code example shows how to use the following methods:canConvert
				} 
			} 
			if (td == null) {
				td = TypeDescriptor.valueOf(valueTypeForLookup);
			} 
			if (this.conversionService.canConvert(TypeDescriptor.valueOf(String.class), td)) {
				editor = new ConvertingPropertyEditorAdapter(this.conversionService, td);
			} 
		} 
		return editor;
	} 
 
 
	/** 
	 * Provide the PropertyAccessor to work with, according to the 
	 * concrete strategy of access. 
	 * <p>Note that a PropertyAccessor used by a BindingResult should 
	 * always have its "extractOldValueForEditor" flag set to "true" 
	 * by default, since this is typically possible without side effects 
	 * for model objects that serve as data binding target. 
5
CodeRank
See Code Examples for Spring Framework ConversionService Methods: