Examples of findCustomEditor()


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

    bw.registerCustomEditor(null, "list.age", pe);
    TestBean tb = new TestBean();
    bw.setPropertyValue("list", new ArrayList());
    bw.setPropertyValue("list[0]", tb);
    assertEquals(tb, bean.getList().get(0));
    assertEquals(pe, bw.findCustomEditor(int.class, "list.age"));
    assertEquals(pe, bw.findCustomEditor(null, "list.age"));
    assertEquals(pe, bw.findCustomEditor(int.class, "list[0].age"));
    assertEquals(pe, bw.findCustomEditor(null, "list[0].age"));
  }
View Full Code Here

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

    TestBean tb = new TestBean();
    bw.setPropertyValue("list", new ArrayList());
    bw.setPropertyValue("list[0]", tb);
    assertEquals(tb, bean.getList().get(0));
    assertEquals(pe, bw.findCustomEditor(int.class, "list.age"));
    assertEquals(pe, bw.findCustomEditor(null, "list.age"));
    assertEquals(pe, bw.findCustomEditor(int.class, "list[0].age"));
    assertEquals(pe, bw.findCustomEditor(null, "list[0].age"));
  }

  public void testArrayToArrayConversion() throws PropertyVetoException {
View Full Code Here

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

    bw.setPropertyValue("list", new ArrayList());
    bw.setPropertyValue("list[0]", tb);
    assertEquals(tb, bean.getList().get(0));
    assertEquals(pe, bw.findCustomEditor(int.class, "list.age"));
    assertEquals(pe, bw.findCustomEditor(null, "list.age"));
    assertEquals(pe, bw.findCustomEditor(int.class, "list[0].age"));
    assertEquals(pe, bw.findCustomEditor(null, "list[0].age"));
  }

  public void testArrayToArrayConversion() throws PropertyVetoException {
    IndexedTestBean tb = new IndexedTestBean();
View Full Code Here

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

    bw.setPropertyValue("list[0]", tb);
    assertEquals(tb, bean.getList().get(0));
    assertEquals(pe, bw.findCustomEditor(int.class, "list.age"));
    assertEquals(pe, bw.findCustomEditor(null, "list.age"));
    assertEquals(pe, bw.findCustomEditor(int.class, "list[0].age"));
    assertEquals(pe, bw.findCustomEditor(null, "list[0].age"));
  }

  public void testArrayToArrayConversion() throws PropertyVetoException {
    IndexedTestBean tb = new IndexedTestBean();
    BeanWrapper bw = new BeanWrapperImpl(tb);
View Full Code Here

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

        try {
          BeanWrapper bw = new BeanWrapperImpl(element);
          bw.registerCustomEditor(Date.class, new CustomDateEditor(DATE_FORMAT, true));
         
          for (Mapping mapping : mappings) {
            PropertyEditor editor = bw.findCustomEditor(null, mapping.getField());
            if( editor != null ) {
              try {
                Object propertyData = bw.getPropertyValue(mapping.getField());
                editor.setValue(propertyData);
                row[pos] = editor.getAsText();
View Full Code Here

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

    bw.registerCustomEditor(null, "list.age", pe);
    TestBean tb = new TestBean();
    bw.setPropertyValue("list", new ArrayList<Object>());
    bw.setPropertyValue("list[0]", tb);
    assertEquals(tb, bean.getList().get(0));
    assertEquals(pe, bw.findCustomEditor(int.class, "list.age"));
    assertEquals(pe, bw.findCustomEditor(null, "list.age"));
    assertEquals(pe, bw.findCustomEditor(int.class, "list[0].age"));
    assertEquals(pe, bw.findCustomEditor(null, "list[0].age"));
  }
View Full Code Here

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

    TestBean tb = new TestBean();
    bw.setPropertyValue("list", new ArrayList<Object>());
    bw.setPropertyValue("list[0]", tb);
    assertEquals(tb, bean.getList().get(0));
    assertEquals(pe, bw.findCustomEditor(int.class, "list.age"));
    assertEquals(pe, bw.findCustomEditor(null, "list.age"));
    assertEquals(pe, bw.findCustomEditor(int.class, "list[0].age"));
    assertEquals(pe, bw.findCustomEditor(null, "list[0].age"));
  }

  @Test
View Full Code Here

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

    bw.setPropertyValue("list", new ArrayList<Object>());
    bw.setPropertyValue("list[0]", tb);
    assertEquals(tb, bean.getList().get(0));
    assertEquals(pe, bw.findCustomEditor(int.class, "list.age"));
    assertEquals(pe, bw.findCustomEditor(null, "list.age"));
    assertEquals(pe, bw.findCustomEditor(int.class, "list[0].age"));
    assertEquals(pe, bw.findCustomEditor(null, "list[0].age"));
  }

  @Test
  public void testArrayToArrayConversion() throws PropertyVetoException {
View Full Code Here

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

    bw.setPropertyValue("list[0]", tb);
    assertEquals(tb, bean.getList().get(0));
    assertEquals(pe, bw.findCustomEditor(int.class, "list.age"));
    assertEquals(pe, bw.findCustomEditor(null, "list.age"));
    assertEquals(pe, bw.findCustomEditor(int.class, "list[0].age"));
    assertEquals(pe, bw.findCustomEditor(null, "list[0].age"));
  }

  @Test
  public void testArrayToArrayConversion() throws PropertyVetoException {
    IndexedTestBean tb = new IndexedTestBean();
View Full Code Here

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

            String propertyName = field.getFieldConfig().getPropertyName();

            if (bean.isReadableProperty(propertyName)) {
                Object propertyValue = bean.getPropertyValue(propertyName);
                Class<?> propertyType = bean.getPropertyType(propertyName);
                PropertyEditor editor = bean.findCustomEditor(propertyType, propertyName);

                if (editor == null) {
                    editor = BeanUtils.findEditorByConvention(propertyType);
                }
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.