Examples of DefaultConversionService


Examples of org.springframework.core.convert.support.DefaultConversionService

   * Instantiates a new bean factory type converter.
   */
  public BeanFactoryTypeConverter() {
    synchronized (BeanFactoryTypeConverter.class) {
      if (defaultConversionService == null) {
        defaultConversionService = new DefaultConversionService();
      }
    }
    this.conversionService = defaultConversionService;
  }
View Full Code Here

Examples of org.springframework.core.convert.support.DefaultConversionService

   * <p>Creates a simple {@link GenericConversionService} instance by default.
   * Subclasses may override to customize the ConversionService instance that
   * gets created.
   */
  protected GenericConversionService createConversionService() {
    return new DefaultConversionService();
  }
View Full Code Here

Examples of org.springframework.core.convert.support.DefaultConversionService


  public StandardTypeConverter() {
    synchronized (this) {
      if (defaultConversionService == null) {
        defaultConversionService = new DefaultConversionService();
      }
    }
    this.conversionService = defaultConversionService;
  }
View Full Code Here

Examples of org.springframework.core.convert.support.DefaultConversionService

  DomainObjectMerger merger;

  @Before
  public void setUp() {
    this.merger = new DomainObjectMerger(new Repositories(context.getBeanFactory()), new DefaultConversionService());
  }
View Full Code Here

Examples of org.springframework.core.convert.support.DefaultConversionService

  @Configuration
  public static class Config {

    @Bean
    public ConversionService webSocketConversionService() {
      GenericConversionService conversionService = new DefaultConversionService();
      conversionService.addConverter(new MyTypeToStringConverter());
      conversionService.addConverter(new MyTypeToBytesConverter());
      conversionService.addConverter(new StringToMyTypeConverter());
      conversionService.addConverter(new BytesToMyTypeConverter());
      return conversionService;
    }
View Full Code Here

Examples of org.springframework.core.convert.support.DefaultConversionService

  @Test
  public void testNullNestedTypeDescriptor() {
    Foo foo = new Foo();
    BeanWrapperImpl wrapper = new BeanWrapperImpl(foo);
    wrapper.setConversionService(new DefaultConversionService());
    wrapper.setAutoGrowNestedPaths(true);
    wrapper.setPropertyValue("listOfMaps[0]['luckyNumber']", "9");
    assertEquals("9", foo.listOfMaps.get(0).get("luckyNumber"));
  }
View Full Code Here

Examples of org.springframework.core.convert.support.DefaultConversionService

  @Test
  public void testNullNestedTypeDescriptor2() {
    Foo foo = new Foo();
    BeanWrapperImpl wrapper = new BeanWrapperImpl(foo);
    wrapper.setConversionService(new DefaultConversionService());
    wrapper.setAutoGrowNestedPaths(true);
    Map<String, String> map = new HashMap<String, String>();
    map.put("favoriteNumber", "9");
    wrapper.setPropertyValue("list[0]", map);
    assertEquals(map, foo.list.get(0));
View Full Code Here

Examples of org.springframework.core.convert.support.DefaultConversionService

  private ConversionService conversionService;

  public BeanFactoryTypeConverter() {
    synchronized (this) {
      if (defaultConversionService == null) {
        defaultConversionService = new DefaultConversionService();
      }
    }
    this.conversionService = defaultConversionService;
  }
View Full Code Here

Examples of org.springframework.core.convert.support.DefaultConversionService

    this.testBeanModelAttr = new MethodParameter(method, 0);
    this.testBeanWithoutStringConstructorModelAttr = new MethodParameter(method, 1);
    this.testBeanWithOptionalModelAttr = new MethodParameter(method, 2);

    ConfigurableWebBindingInitializer initializer = new ConfigurableWebBindingInitializer();
    initializer.setConversionService(new DefaultConversionService());

    this.binderFactory = new ServletRequestDataBinderFactory(null, initializer);
    this.mavContainer = new ModelAndViewContainer();

    this.request = new MockHttpServletRequest();
View Full Code Here

Examples of org.springframework.core.convert.support.DefaultConversionService

  }

  @Test
  public void resolveOptional() throws Exception {
    ConfigurableWebBindingInitializer initializer = new ConfigurableWebBindingInitializer();
    initializer.setConversionService(new DefaultConversionService());
    WebDataBinderFactory binderFactory = new DefaultDataBinderFactory(initializer);

    Object result = resolver.resolveArgument(paramOptional, null, webRequest, binderFactory);
    assertEquals(Optional.class, result.getClass());
    assertEquals(Optional.empty(), result);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.