Package org.springframework.binding.convert.service

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


  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

   * 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

    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

    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

TOP

Related Classes of org.springframework.binding.convert.service.GenericConversionService

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.