Examples of registerCustomEditor()


Examples of org.springframework.beans.BeanWrapper.registerCustomEditor()

    bw.registerCustomEditor(short.class, new CustomNumberEditor(Short.class, nf, false));
    bw.registerCustomEditor(Short.class, new CustomNumberEditor(Short.class, nf, false));
    bw.registerCustomEditor(int.class, new CustomNumberEditor(Integer.class, nf, false));
    bw.registerCustomEditor(Integer.class, new CustomNumberEditor(Integer.class, nf, false));
    bw.registerCustomEditor(long.class, new CustomNumberEditor(Long.class, nf, false));
    bw.registerCustomEditor(Long.class, new CustomNumberEditor(Long.class, nf, false));
    bw.registerCustomEditor(BigInteger.class, new CustomNumberEditor(BigInteger.class, nf, false));
    bw.registerCustomEditor(float.class, new CustomNumberEditor(Float.class, nf, false));
    bw.registerCustomEditor(Float.class, new CustomNumberEditor(Float.class, nf, false));
    bw.registerCustomEditor(double.class, new CustomNumberEditor(Double.class, nf, false));
    bw.registerCustomEditor(Double.class, new CustomNumberEditor(Double.class, nf, false));
View Full Code Here

Examples of org.springframework.beans.BeanWrapper.registerCustomEditor()

    bw.registerCustomEditor(Short.class, new CustomNumberEditor(Short.class, nf, false));
    bw.registerCustomEditor(int.class, new CustomNumberEditor(Integer.class, nf, false));
    bw.registerCustomEditor(Integer.class, new CustomNumberEditor(Integer.class, nf, false));
    bw.registerCustomEditor(long.class, new CustomNumberEditor(Long.class, nf, false));
    bw.registerCustomEditor(Long.class, new CustomNumberEditor(Long.class, nf, false));
    bw.registerCustomEditor(BigInteger.class, new CustomNumberEditor(BigInteger.class, nf, false));
    bw.registerCustomEditor(float.class, new CustomNumberEditor(Float.class, nf, false));
    bw.registerCustomEditor(Float.class, new CustomNumberEditor(Float.class, nf, false));
    bw.registerCustomEditor(double.class, new CustomNumberEditor(Double.class, nf, false));
    bw.registerCustomEditor(Double.class, new CustomNumberEditor(Double.class, nf, false));
    bw.registerCustomEditor(BigDecimal.class, new CustomNumberEditor(BigDecimal.class, nf, false));
View Full Code Here

Examples of org.springframework.beans.BeanWrapper.registerCustomEditor()

    bw.registerCustomEditor(int.class, new CustomNumberEditor(Integer.class, nf, false));
    bw.registerCustomEditor(Integer.class, new CustomNumberEditor(Integer.class, nf, false));
    bw.registerCustomEditor(long.class, new CustomNumberEditor(Long.class, nf, false));
    bw.registerCustomEditor(Long.class, new CustomNumberEditor(Long.class, nf, false));
    bw.registerCustomEditor(BigInteger.class, new CustomNumberEditor(BigInteger.class, nf, false));
    bw.registerCustomEditor(float.class, new CustomNumberEditor(Float.class, nf, false));
    bw.registerCustomEditor(Float.class, new CustomNumberEditor(Float.class, nf, false));
    bw.registerCustomEditor(double.class, new CustomNumberEditor(Double.class, nf, false));
    bw.registerCustomEditor(Double.class, new CustomNumberEditor(Double.class, nf, false));
    bw.registerCustomEditor(BigDecimal.class, new CustomNumberEditor(BigDecimal.class, nf, false));
View Full Code Here

Examples of org.springframework.beans.BeanWrapper.registerCustomEditor()

    bw.registerCustomEditor(Integer.class, new CustomNumberEditor(Integer.class, nf, false));
    bw.registerCustomEditor(long.class, new CustomNumberEditor(Long.class, nf, false));
    bw.registerCustomEditor(Long.class, new CustomNumberEditor(Long.class, nf, false));
    bw.registerCustomEditor(BigInteger.class, new CustomNumberEditor(BigInteger.class, nf, false));
    bw.registerCustomEditor(float.class, new CustomNumberEditor(Float.class, nf, false));
    bw.registerCustomEditor(Float.class, new CustomNumberEditor(Float.class, nf, false));
    bw.registerCustomEditor(double.class, new CustomNumberEditor(Double.class, nf, false));
    bw.registerCustomEditor(Double.class, new CustomNumberEditor(Double.class, nf, false));
    bw.registerCustomEditor(BigDecimal.class, new CustomNumberEditor(BigDecimal.class, nf, false));

    bw.setPropertyValue("short1", "1");
View Full Code Here

Examples of org.springframework.beans.BeanWrapper.registerCustomEditor()

    bw.registerCustomEditor(long.class, new CustomNumberEditor(Long.class, nf, false));
    bw.registerCustomEditor(Long.class, new CustomNumberEditor(Long.class, nf, false));
    bw.registerCustomEditor(BigInteger.class, new CustomNumberEditor(BigInteger.class, nf, false));
    bw.registerCustomEditor(float.class, new CustomNumberEditor(Float.class, nf, false));
    bw.registerCustomEditor(Float.class, new CustomNumberEditor(Float.class, nf, false));
    bw.registerCustomEditor(double.class, new CustomNumberEditor(Double.class, nf, false));
    bw.registerCustomEditor(Double.class, new CustomNumberEditor(Double.class, nf, false));
    bw.registerCustomEditor(BigDecimal.class, new CustomNumberEditor(BigDecimal.class, nf, false));

    bw.setPropertyValue("short1", "1");
    bw.setPropertyValue("short2", "2");
View Full Code Here

Examples of org.springframework.beans.BeanWrapper.registerCustomEditor()

    bw.registerCustomEditor(Long.class, new CustomNumberEditor(Long.class, nf, false));
    bw.registerCustomEditor(BigInteger.class, new CustomNumberEditor(BigInteger.class, nf, false));
    bw.registerCustomEditor(float.class, new CustomNumberEditor(Float.class, nf, false));
    bw.registerCustomEditor(Float.class, new CustomNumberEditor(Float.class, nf, false));
    bw.registerCustomEditor(double.class, new CustomNumberEditor(Double.class, nf, false));
    bw.registerCustomEditor(Double.class, new CustomNumberEditor(Double.class, nf, false));
    bw.registerCustomEditor(BigDecimal.class, new CustomNumberEditor(BigDecimal.class, nf, false));

    bw.setPropertyValue("short1", "1");
    bw.setPropertyValue("short2", "2");
    bw.setPropertyValue("int1", "7");
View Full Code Here

Examples of org.springframework.beans.BeanWrapper.registerCustomEditor()

    bw.registerCustomEditor(BigInteger.class, new CustomNumberEditor(BigInteger.class, nf, false));
    bw.registerCustomEditor(float.class, new CustomNumberEditor(Float.class, nf, false));
    bw.registerCustomEditor(Float.class, new CustomNumberEditor(Float.class, nf, false));
    bw.registerCustomEditor(double.class, new CustomNumberEditor(Double.class, nf, false));
    bw.registerCustomEditor(Double.class, new CustomNumberEditor(Double.class, nf, false));
    bw.registerCustomEditor(BigDecimal.class, new CustomNumberEditor(BigDecimal.class, nf, false));

    bw.setPropertyValue("short1", "1");
    bw.setPropertyValue("short2", "2");
    bw.setPropertyValue("int1", "7");
    bw.setPropertyValue("int2", "8");
View Full Code Here

Examples of org.springframework.beans.BeanWrapper.registerCustomEditor()

  public void testCustomNumberEditorWithAllowEmpty() {
    NumberFormat nf = NumberFormat.getNumberInstance(Locale.GERMAN);
    NumberTestBean tb = new NumberTestBean();
    BeanWrapper bw = new BeanWrapperImpl(tb);
    bw.registerCustomEditor(long.class, new CustomNumberEditor(Long.class, nf, true));
    bw.registerCustomEditor(Long.class, new CustomNumberEditor(Long.class, nf, true));

    bw.setPropertyValue("long1", "5");
    bw.setPropertyValue("long2", "6");
    assertTrue("Correct long1 value", new Long("5").equals(bw.getPropertyValue("long1")));
View Full Code Here

Examples of org.springframework.beans.BeanWrapper.registerCustomEditor()

  public void testCustomNumberEditorWithAllowEmpty() {
    NumberFormat nf = NumberFormat.getNumberInstance(Locale.GERMAN);
    NumberTestBean tb = new NumberTestBean();
    BeanWrapper bw = new BeanWrapperImpl(tb);
    bw.registerCustomEditor(long.class, new CustomNumberEditor(Long.class, nf, true));
    bw.registerCustomEditor(Long.class, new CustomNumberEditor(Long.class, nf, true));

    bw.setPropertyValue("long1", "5");
    bw.setPropertyValue("long2", "6");
    assertTrue("Correct long1 value", new Long("5").equals(bw.getPropertyValue("long1")));
    assertTrue("Correct long1 value", tb.getLong1() == 5);
View Full Code Here

Examples of org.springframework.beans.BeanWrapper.registerCustomEditor()

  public void testCustomNumberEditorWithFrenchBigDecimal() throws Exception {
    NumberFormat nf = NumberFormat.getNumberInstance(Locale.FRENCH);
    NumberTestBean tb = new NumberTestBean();
    BeanWrapper bw = new BeanWrapperImpl(tb);
    bw.registerCustomEditor(BigDecimal.class, new CustomNumberEditor(BigDecimal.class, nf, true));
    bw.setPropertyValue("bigDecimal", "1000");
    assertEquals(1000.0f, tb.getBigDecimal().floatValue(), 0f);
    bw.setPropertyValue("bigDecimal", "1000,5");
    assertEquals(1000.5f, tb.getBigDecimal().floatValue(), 0f);
    bw.setPropertyValue("bigDecimal", "1 000,5");
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.