Package org.springframework.core.convert.support

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


  DefaultConversionService conversionService;

  @Before
  public void setUp() {

    this.conversionService = new DefaultConversionService();
    QueryExecutionConverters.registerConvertersIn(conversionService);
  }
View Full Code Here


        Object target) {

      Assert.notNull(repositoryInformation, "RepositoryInformation must not be null!");
      Assert.notNull(target, "Target must not be null!");

      DefaultConversionService conversionService = new DefaultConversionService();
      QueryExecutionConverters.registerConvertersIn(conversionService);
      this.conversionService = conversionService;

      this.repositoryInformation = repositoryInformation;
      this.customImplementation = customImplementation;
View Full Code Here

        return new ObjectMapper();
    }

    @Bean(name = "mvcConversionService")
    public ConversionService conversionService() {
        DefaultConversionService service = new DefaultConversionService();
        return service;
    }
View Full Code Here

    GenericApplicationContext context = new GenericApplicationContext(beanFactory);
    context.refresh();
    assertThat(context.getBeansOfType(RepositoryFactoryInformation.class).values().size(), is(1));

    DomainClassConverter converter = new DomainClassConverter(new DefaultConversionService());
    converter.setApplicationContext(context);

    assertThat(converter.matches(TypeDescriptor.valueOf(String.class), TypeDescriptor.valueOf(Person.class)), is(true));
  }
View Full Code Here

   * 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

   * <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


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

  DomainObjectMerger merger;

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

  @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

  @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

TOP

Related Classes of org.springframework.core.convert.support.DefaultConversionService

Copyright © 2018 www.massapicom. 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.