Examples of GenericConversionService


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

   * default implementation registers Web Flow-specific converters thought to be useful for most builder
   * implementations, setting the externally-provided builder services conversion service as its parent.
   * @return the flow builder conversion service
   */
  protected ConversionService createConversionService() {
    GenericConversionService service = new GenericConversionService();
    service.addConverter(new TextToTransitionCriteria(this));
    service.addConverter(new TextToTargetStateResolver(this));
    service.setParent(new ParentConversionServiceProxy());
    return service;
  }
View Full Code Here

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

  private SpringELExpressionParser createExpressionParser() {
    StringToDate c = new StringToDate();
    c.setPattern("yyyy-MM-dd");
    SpringELExpressionParser parser = new WebFlowSpringELExpressionParser(new SpelExpressionParser());
    GenericConversionService cs = (GenericConversionService) parser.getConversionService();
    cs.addConverter(c);
    return parser;
  }
View Full Code Here

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

   * default implementation registers Web Flow-specific converters thought to be useful for most builder
   * implementations, setting the externally-provided builder services conversion service as its parent.
   * @return the flow builder conversion service
   */
  protected ConversionService createConversionService() {
    GenericConversionService service = new GenericConversionService(getFlowBuilderServices().getConversionService()
        .getDelegateConversionService());
    service.addConverter(new TextToTransitionCriteria(this));
    service.addConverter(new TextToTargetStateResolver(this));
    service.setParent(new ParentConversionServiceProxy());
    return service;
  }
View Full Code Here

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

    Expression e = parser.parseExpression(exp, null);
    assertEquals(null, e.getValueType(bean));
  }

  public void testSetValueWithCoersion() {
    GenericConversionService cs = (GenericConversionService) parser.getConversionService();
    StringToDate converter = new StringToDate();
    converter.setPattern("yyyy-MM-dd");
    cs.addConverter(converter);
    Expression e = parser.parseExpression("date", null);
    e.setValue(bean, "2008-9-15");
  }
View Full Code Here

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

    exp.setValue(context, 5);
    assertEquals(5, context.getNumber());
  }

  public void testSetValueWithCoersion() {
    GenericConversionService cs = (GenericConversionService) parser.getConversionService();
    StringToDate converter = new StringToDate();
    converter.setPattern("yyyy-MM-dd");
    cs.addConverter(converter);
    Expression e = parser.parseExpression("date", null);
    e.setValue(bean, "2008-9-15");
  }
View Full Code Here

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

    ConversionExecutor convertFrom = null;

    // Check for locally registered property converters
    if (propertyConversionServices.containsKey(formProperty)) {
      // TODO - extract ConfigurableConversionService interface...
      final GenericConversionService propertyConversionService = (GenericConversionService) propertyConversionServices
          .get(formProperty);

      if (propertyConversionService != null) {
        convertTo = propertyConversionService.getConversionExecutor(sourceClass, targetClass);
        convertFrom = propertyConversionService.getConversionExecutor(targetClass, sourceClass);
      }
    }

    // If we have nothing from the property level, then try the conversion
    // service
View Full Code Here

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

  private static RepositoryInvoker getInvokerFor(Object repository, VerifyingMethodInterceptor interceptor) {

    Object proxy = getVerifyingRepositoryProxy(repository, interceptor);

    RepositoryMetadata metadata = new DefaultRepositoryMetadata(repository.getClass().getInterfaces()[0]);
    GenericConversionService conversionService = new DefaultFormattingConversionService();

    return new CrudRepositoryInvoker((CrudRepository) proxy, metadata, conversionService);
  }
View Full Code Here

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

  }

  @InitBinder
  void registerConverters(WebDataBinder binder) {
    if (binder.getConversionService() instanceof GenericConversionService) {
      GenericConversionService conversionService = (GenericConversionService) binder.getConversionService();
      conversionService.addConverter(getLoanSharkConverter());
    }
  }
View Full Code Here

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

  @SuppressWarnings({ "unchecked", "rawtypes" })
  private static RepositoryInvoker getInvokerFor(Object repository) {

    RepositoryMetadata metadata = new DefaultRepositoryMetadata(repository.getClass().getInterfaces()[0]);
    GenericConversionService conversionService = new DefaultFormattingConversionService();

    return new PagingAndSortingRepositoryInvoker((PagingAndSortingRepository) repository, metadata, conversionService);
  }
View Full Code Here

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

  }

  private static RepositoryInvoker getInvokerFor(Object repository) {

    RepositoryMetadata metadata = new DefaultRepositoryMetadata(repository.getClass().getInterfaces()[0]);
    GenericConversionService conversionService = new DefaultFormattingConversionService();

    return new ReflectionRepositoryInvoker(repository, metadata, conversionService);
  }
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.