Examples of DefaultConversionService


Examples of org.springframework.binding.convert.service.DefaultConversionService

  private ConversionService conversionService;

  private List<PropertyAccessor> propertyAccessors = new ArrayList<PropertyAccessor>();

  public SpringELExpressionParser(SpelExpressionParser expressionParser) {
    this(expressionParser, new DefaultConversionService());
  }
View Full Code Here

Examples of org.springframework.binding.convert.service.DefaultConversionService

        super.setConversionService(conversionService);
        setExpressionParser(new WebFlowSpringELExpressionParser(new SpelExpressionParser(), conversionService));
      }
    };
    services.setViewFactoryCreator(new MockViewFactoryCreator());
    services.setConversionService(new DefaultConversionService());
    services.setApplicationContext(createTestApplicationContext());
    return services;
  }
View Full Code Here

Examples of org.springframework.binding.convert.service.DefaultConversionService

  // implementing InitializingBean

  public void afterPropertiesSet() throws Exception {
    Assert.notNull(flowDefinitionLocator, "The flow definition locator property is required");
    if (conversionService == null) {
      conversionService = new DefaultConversionService();
    }
    MutableAttributeMap<Object> executionAttributes = createFlowExecutionAttributes();
    FlowExecutionImplFactory executionFactory = createFlowExecutionFactory(executionAttributes);
    DefaultFlowExecutionRepository executionRepository = createFlowExecutionRepository(executionFactory);
    executionFactory.setExecutionKeyFactory(executionRepository);
View Full Code Here

Examples of org.springframework.binding.convert.service.DefaultConversionService

  /**
   * Creates a new expression parser that uses a {@link DefaultConversionService} to perform type conversion.
   */
  public BeanWrapperExpressionParser() {
    this.conversionService = new DefaultConversionService();
  }
View Full Code Here

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

   * @param propertyName name of property on which to register converters
   * @param toConverter Convert from source to target type
   * @param fromConverter Convert from target to source type
   */
  public void registerPropertyConverter(String propertyName, Converter toConverter, Converter fromConverter) {
    DefaultConversionService propertyConversionService = (DefaultConversionService) propertyConversionServices
        .get(propertyName);
    propertyConversionService.addConverter(toConverter);
    propertyConversionService.addConverter(fromConverter);
  }
View Full Code Here

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

  /**
   * Creates the conversion service.  Subclasses may override to customize creation.
   * @return the configured conversion service
   */
  protected ConversionService createConversionService() {
    DefaultConversionService service = new DefaultConversionService();
    service.addConverter(new TextToDate(getFormatterFactory(), true));
    service.addConverter(new DateToText(getFormatterFactory(), true));
    service.addConverter(new TextToNumber(getFormatterFactory(), true));
    service.addConverter(new NumberToText(getFormatterFactory(), true));
    service.addConverter(new BooleanToText());
    service.addConverter(new TextToBoolean());
    service.addConverter(new CollectionConverter());
    service.addConverter(new ListModelConverter());
    return service;
  }
View Full Code Here

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

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

        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

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

        return new ObjectMapper();
    }

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

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

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