Examples of registerCustomEditor()


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

  }

  public void testIndexedPropertiesWithDirectAccessAndPropertyEditors() {
    IndexedTestBean bean = new IndexedTestBean();
    BeanWrapper bw = new BeanWrapperImpl(bean);
    bw.registerCustomEditor(TestBean.class, "array", new PropertyEditorSupport() {
      public void setAsText(String text) throws IllegalArgumentException {
        setValue(new TestBean("array" + text, 99));
      }

      public String getAsText() {
View Full Code Here

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

      public String getAsText() {
        return ((TestBean) getValue()).getName();
      }
    });
    bw.registerCustomEditor(TestBean.class, "list", new PropertyEditorSupport() {
      public void setAsText(String text) throws IllegalArgumentException {
        setValue(new TestBean("list" + text, 99));
      }

      public String getAsText() {
View Full Code Here

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

      public String getAsText() {
        return ((TestBean) getValue()).getName();
      }
    });
    bw.registerCustomEditor(TestBean.class, "map", new PropertyEditorSupport() {
      public void setAsText(String text) throws IllegalArgumentException {
        setValue(new TestBean("map" + text, 99));
      }

      public String getAsText() {
View Full Code Here

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

  }

  public void testIndexedPropertiesWithDirectAccessAndSpecificPropertyEditors() {
    IndexedTestBean bean = new IndexedTestBean();
    BeanWrapper bw = new BeanWrapperImpl(bean);
    bw.registerCustomEditor(TestBean.class, "array[0]", new PropertyEditorSupport() {
      public void setAsText(String text) throws IllegalArgumentException {
        setValue(new TestBean("array0" + text, 99));
      }

      public String getAsText() {
View Full Code Here

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

      public String getAsText() {
        return ((TestBean) getValue()).getName();
      }
    });
    bw.registerCustomEditor(TestBean.class, "array[1]", new PropertyEditorSupport() {
      public void setAsText(String text) throws IllegalArgumentException {
        setValue(new TestBean("array1" + text, 99));
      }

      public String getAsText() {
View Full Code Here

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

      public String getAsText() {
        return ((TestBean) getValue()).getName();
      }
    });
    bw.registerCustomEditor(TestBean.class, "list[0]", new PropertyEditorSupport() {
      public void setAsText(String text) throws IllegalArgumentException {
        setValue(new TestBean("list0" + text, 99));
      }

      public String getAsText() {
View Full Code Here

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

      public String getAsText() {
        return ((TestBean) getValue()).getName();
      }
    });
    bw.registerCustomEditor(TestBean.class, "list[1]", new PropertyEditorSupport() {
      public void setAsText(String text) throws IllegalArgumentException {
        setValue(new TestBean("list1" + text, 99));
      }

      public String getAsText() {
View Full Code Here

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

      public String getAsText() {
        return ((TestBean) getValue()).getName();
      }
    });
    bw.registerCustomEditor(TestBean.class, "map[key1]", new PropertyEditorSupport() {
      public void setAsText(String text) throws IllegalArgumentException {
        setValue(new TestBean("mapkey1" + text, 99));
      }

      public String getAsText() {
View Full Code Here

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

      public String getAsText() {
        return ((TestBean) getValue()).getName();
      }
    });
    bw.registerCustomEditor(TestBean.class, "map[key2]", new PropertyEditorSupport() {
      public void setAsText(String text) throws IllegalArgumentException {
        setValue(new TestBean("mapkey2" + text, 99));
      }

      public String getAsText() {
View Full Code Here

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

  }

  public void testIndexedPropertiesWithListPropertyEditor() {
    IndexedTestBean bean = new IndexedTestBean();
    BeanWrapper bw = new BeanWrapperImpl(bean);
    bw.registerCustomEditor(List.class, "list", new PropertyEditorSupport() {
      public void setAsText(String text) throws IllegalArgumentException {
        List result = new ArrayList();
        result.add(new TestBean("list" + text, 99));
        setValue(result);
      }
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.