Java Code Examples for org.springframework.beans.BeanWrapper#setConversionService()

The following examples show how to use org.springframework.beans.BeanWrapper#setConversionService() . 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: AbstractBinder.java    From jdal with Apache License 2.0 5 votes vote down vote up
private BeanWrapper getBeanWrapper() {
	BeanWrapper wrapper = PropertyAccessorFactory.forBeanPropertyAccess(getModel());
	wrapper.setConversionService(getConversionService());
	wrapper.registerCustomEditor(Date.class, 
			new CustomDateEditor(SimpleDateFormat.getDateTimeInstance(), true));
	
	return wrapper;
}
 
Example 2
Source File: BeanPropertyRowMapper.java    From spring-analysis-note with MIT License 3 votes vote down vote up
/**
 * Initialize the given BeanWrapper to be used for row mapping.
 * To be called for each row.
 * <p>The default implementation applies the configured {@link ConversionService},
 * if any. Can be overridden in subclasses.
 * @param bw the BeanWrapper to initialize
 * @see #getConversionService()
 * @see BeanWrapper#setConversionService
 */
protected void initBeanWrapper(BeanWrapper bw) {
	ConversionService cs = getConversionService();
	if (cs != null) {
		bw.setConversionService(cs);
	}
}
 
Example 3
Source File: BeanPropertyRowMapper.java    From yue-library with Apache License 2.0 3 votes vote down vote up
/**
 * Initialize the given BeanWrapper to be used for row mapping.
 * To be called for each row.
 * <p>The default implementation applies the configured {@link ConversionService},
 * if any. Can be overridden in subclasses.
 * @param bw the BeanWrapper to initialize
 * @see #getConversionService()
 * @see BeanWrapper#setConversionService
 */
protected void initBeanWrapper(BeanWrapper bw) {
	ConversionService cs = getConversionService();
	if (cs != null) {
		bw.setConversionService(cs);
	}
}
 
Example 4
Source File: BeanPropertyRowMapper.java    From java-technology-stack with MIT License 3 votes vote down vote up
/**
 * Initialize the given BeanWrapper to be used for row mapping.
 * To be called for each row.
 * <p>The default implementation applies the configured {@link ConversionService},
 * if any. Can be overridden in subclasses.
 * @param bw the BeanWrapper to initialize
 * @see #getConversionService()
 * @see BeanWrapper#setConversionService
 */
protected void initBeanWrapper(BeanWrapper bw) {
	ConversionService cs = getConversionService();
	if (cs != null) {
		bw.setConversionService(cs);
	}
}
 
Example 5
Source File: BeanPropertyRowMapper.java    From lams with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Initialize the given BeanWrapper to be used for row mapping.
 * To be called for each row.
 * <p>The default implementation applies the configured {@link ConversionService},
 * if any. Can be overridden in subclasses.
 * @param bw the BeanWrapper to initialize
 * @see #getConversionService()
 * @see BeanWrapper#setConversionService
 */
protected void initBeanWrapper(BeanWrapper bw) {
	ConversionService cs = getConversionService();
	if (cs != null) {
		bw.setConversionService(cs);
	}
}
 
Example 6
Source File: AbstractBeanFactory.java    From spring-analysis-note with MIT License 2 votes vote down vote up
/**
 * Initialize the given BeanWrapper with the custom editors registered
 * with this factory. To be called for BeanWrappers that will create
 * and populate bean instances.
 * <p>The default implementation delegates to {@link #registerCustomEditors}.
 * Can be overridden in subclasses.
 * @param bw the BeanWrapper to initialize
 */
protected void initBeanWrapper(BeanWrapper bw) {
	bw.setConversionService(getConversionService());
	registerCustomEditors(bw);
}
 
Example 7
Source File: AbstractBeanFactory.java    From java-technology-stack with MIT License 2 votes vote down vote up
/**
 * Initialize the given BeanWrapper with the custom editors registered
 * with this factory. To be called for BeanWrappers that will create
 * and populate bean instances.
 * <p>The default implementation delegates to {@link #registerCustomEditors}.
 * Can be overridden in subclasses.
 * @param bw the BeanWrapper to initialize
 */
protected void initBeanWrapper(BeanWrapper bw) {
	bw.setConversionService(getConversionService());
	registerCustomEditors(bw);
}
 
Example 8
Source File: AbstractBeanFactory.java    From lams with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Initialize the given BeanWrapper with the custom editors registered
 * with this factory. To be called for BeanWrappers that will create
 * and populate bean instances.
 * <p>The default implementation delegates to {@link #registerCustomEditors}.
 * Can be overridden in subclasses.
 * @param bw the BeanWrapper to initialize
 */
protected void initBeanWrapper(BeanWrapper bw) {
	bw.setConversionService(getConversionService());
	registerCustomEditors(bw);
}
 
Example 9
Source File: AbstractBeanFactory.java    From blog_demos with Apache License 2.0 2 votes vote down vote up
/**
 * Initialize the given BeanWrapper with the custom editors registered
 * with this factory. To be called for BeanWrappers that will create
 * and populate bean instances.
 * <p>The default implementation delegates to {@link #registerCustomEditors}.
 * Can be overridden in subclasses.
 * @param bw the BeanWrapper to initialize
 */
protected void initBeanWrapper(BeanWrapper bw) {
	bw.setConversionService(getConversionService());
	registerCustomEditors(bw);
}
 
Example 10
Source File: AbstractBeanFactory.java    From spring4-understanding with Apache License 2.0 2 votes vote down vote up
/**
 * Initialize the given BeanWrapper with the custom editors registered
 * with this factory. To be called for BeanWrappers that will create
 * and populate bean instances.
 * <p>The default implementation delegates to {@link #registerCustomEditors}.
 * Can be overridden in subclasses.
 * @param bw the BeanWrapper to initialize
 */
protected void initBeanWrapper(BeanWrapper bw) {
	bw.setConversionService(getConversionService());
	registerCustomEditors(bw);
}