Package org.springframework.binding.format

Examples of org.springframework.binding.format.DefaultNumberFormatFactory


  }

  public void testRegisterConverter() {
    GenericConversionService service = new GenericConversionService();
    FormattedStringToNumber converter = new FormattedStringToNumber();
    DefaultNumberFormatFactory numberFormatFactory = new DefaultNumberFormatFactory();
    numberFormatFactory.setLocale(Locale.US);
    converter.setNumberFormatFactory(numberFormatFactory);
    service.addConverter(converter);
    ConversionExecutor executor = service.getConversionExecutor(String.class, Integer.class);
    Integer three = (Integer) executor.execute("3,000");
    assertEquals(3000, three.intValue());
View Full Code Here


  }

  public void testRegisterCustomConverter() {
    DefaultConversionService service = new DefaultConversionService();
    FormattedStringToNumber converter = new FormattedStringToNumber();
    DefaultNumberFormatFactory numberFormatFactory = new DefaultNumberFormatFactory();
    numberFormatFactory.setLocale(Locale.US);
    converter.setNumberFormatFactory(numberFormatFactory);
    service.addConverter("usaNumber", converter);
    ConversionExecutor executor = service.getConversionExecutor("usaNumber", String.class, Integer.class);
    Integer three = (Integer) executor.execute("3,000");
    assertEquals(3000, three.intValue());
View Full Code Here

  }

  public void testRegisterConverter() {
    GenericConversionService service = new GenericConversionService();
    FormattedStringToNumber converter = new FormattedStringToNumber();
    DefaultNumberFormatFactory numberFormatFactory = new DefaultNumberFormatFactory();
    numberFormatFactory.setLocale(Locale.US);
    converter.setNumberFormatFactory(numberFormatFactory);
    service.addConverter(converter);
    ConversionExecutor executor = service.getConversionExecutor(String.class, Integer.class);
    Integer three = (Integer) executor.execute("3,000");
    assertEquals(new Integer(3000), three);
View Full Code Here

  }

  public void testRegisterCustomConverter() {
    DefaultConversionService service = new DefaultConversionService();
    FormattedStringToNumber converter = new FormattedStringToNumber();
    DefaultNumberFormatFactory numberFormatFactory = new DefaultNumberFormatFactory();
    numberFormatFactory.setLocale(Locale.US);
    converter.setNumberFormatFactory(numberFormatFactory);
    service.addConverter("usaNumber", converter);
    ConversionExecutor executor = service.getConversionExecutor("usaNumber", String.class, Integer.class);
    Integer three = (Integer) executor.execute("3,000");
    assertEquals(new Integer(3000), three);
View Full Code Here

TOP

Related Classes of org.springframework.binding.format.DefaultNumberFormatFactory

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.