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

This code example shows how to use the following methods:afterPropertiesSet, getObject
	private MockPageContext context; 
 
	@Override 
	protected void setUp() throws Exception { 
		context = createPageContext(); 
		FormattingConversionServiceFactoryBean factory = new FormattingConversionServiceFactoryBean(); 
		factory.afterPropertiesSet(); 
		context.getRequest().setAttribute("org.springframework.core.convert.ConversionService", factory.getObject()); 
		context.getRequest().setAttribute("bean", new Bean()); 
		tag = new EvalTag(); 
		tag.setPageContext(context); 
	} 
 
	public void testPrintScopedAttributeResult() throws Exception { 
		tag.setExpression("bean.method()"); 
		int action = tag.doStartTag(); 
		assertEquals(Tag.EVAL_BODY_INCLUDE, action); 
		action = tag.doEndTag(); 
		assertEquals(Tag.EVAL_PAGE, action); 
		assertEquals("foo", ((MockHttpServletResponse) context.getResponse()).getContentAsString()); 
7
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:afterPropertiesSet, getObject
		return adapter; 
	} 
 
	@Bean 
	public ConversionService conversionService() { 
		FormattingConversionServiceFactoryBean fb = new FormattingConversionServiceFactoryBean(); 
		fb.afterPropertiesSet(); 
		FormattingConversionService cs = fb.getObject(); 
		return cs; 
	} 
 
	private Validator getValidator() { 
		LocalValidatorFactoryBean validator = new LocalValidatorFactoryBean(); 
		validator.afterPropertiesSet(); 
		return validator; 
	} 
 
	private HttpMessageConverter<?>[] getMessageConverters() { 
		HttpMessageConverter<?>[] converters = new HttpMessageConverter<?>[]{ 
				new ByteArrayHttpMessageConverter(), 
6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:
package org.springframework.samples.mvc.convert; 
 
import org.springframework.format.FormatterRegistry;
import org.springframework.format.support.FormattingConversionServiceFactoryBean;
 
public class CustomConversionServiceFactoryBean extends FormattingConversionServiceFactoryBean {
 
	@Override 
	protected void installFormatters(FormatterRegistry registry) {
		// register the default formatters in superclass 
		super.installFormatters(registry);
		// install my custom ones 
		registry.addFormatterForFieldAnnotation(new MaskFormatAnnotationFormatterFactory());
	} 
 
	 
} 
5
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:afterPropertiesSet, getObject
 
	/** 
	 * Default constructor. 
	 */ 
	public GenericConversionService() { 
		FormattingConversionServiceFactoryBean factoryBean = new FormattingConversionServiceFactoryBean();
		factoryBean.afterPropertiesSet();
		this.delegate = factoryBean.getObject();
	} 
 
	/** 
	 * Constructor accepting a specific instance of a Spring ConversionService to delegate to. 
	 * @param delegateConversionService the conversion service 
	 */ 
	public GenericConversionService(org.springframework.core.convert.ConversionService delegateConversionService) {
		Assert.notNull(delegateConversionService);
		this.delegate = delegateConversionService;
	} 
 
	/** 
5
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:
package com.springsource.petclinic.web; 
 
import org.springframework.format.FormatterRegistry; 
import org.springframework.format.support.FormattingConversionServiceFactoryBean; 
import org.springframework.roo.addon.web.mvc.controller.RooConversionService; 
 
/** 
 * A central place to register application converters and formatters.  
 */ 
@RooConversionService 
public class ApplicationConversionServiceFactoryBean extends FormattingConversionServiceFactoryBean { 
 
	@Override 
	protected void installFormatters(FormatterRegistry registry) { 
		super.installFormatters(registry); 
		// Register application converters and formatters 
	} 
} 

4
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:
package ee.itcollege.veebirakendused.java.team25.web; 
 
import org.springframework.format.FormatterRegistry; 
import org.springframework.format.support.FormattingConversionServiceFactoryBean; 
import org.springframework.roo.addon.web.mvc.controller.RooConversionService; 
 
/** 
 * A central place to register application converters and formatters.  
 */ 
@RooConversionService 
public class ApplicationConversionServiceFactoryBean extends FormattingConversionServiceFactoryBean { 
 
	@Override 
	protected void installFormatters(FormatterRegistry registry) { 
		super.installFormatters(registry); 
		// Register application converters and formatters 
	} 
} 

4
CodeRank
Experience pair programming with AI  Get Codota for Java
See Code Examples for Spring Framework FormattingConversionServiceFactoryBean Methods: