Package org.springframework.beans

Examples of org.springframework.beans.PropertyEditorRegistrar


  }

  @Test
  public void testGenericMapWithCollectionValueConstructor() throws MalformedURLException {
    DefaultListableBeanFactory bf = new DefaultListableBeanFactory();
    bf.addPropertyEditorRegistrar(new PropertyEditorRegistrar() {
      @Override
      public void registerCustomEditors(PropertyEditorRegistry registry) {
        registry.registerCustomEditor(Number.class, new CustomNumberEditor(Integer.class, false));
      }
    });
View Full Code Here


  }

  @Test
  public void testGenericMapWithCollectionValueFactoryMethod() throws MalformedURLException {
    DefaultListableBeanFactory bf = new DefaultListableBeanFactory();
    bf.addPropertyEditorRegistrar(new PropertyEditorRegistrar() {
      @Override
      public void registerCustomEditors(PropertyEditorRegistry registry) {
        registry.registerCustomEditor(Number.class, new CustomNumberEditor(Integer.class, false));
      }
    });
View Full Code Here

    public void getPropertyEditorRegistrars() {
        // default is empty
        assertEquals(0, getRegisrarsSupport().size());

        // set
        PropertyEditorRegistrar r1 = createMock(PropertyEditorRegistrar.class);
        PropertyEditorRegistrar r2 = createMock(PropertyEditorRegistrar.class);

        formConfig.setPropertyEditorRegistrars(new PropertyEditorRegistrar[] { r1, r2 });
        assertArrayEquals(new PropertyEditorRegistrar[] { r1, r2 }, getRegisrarsSupport().getPropertyEditorRegistrars());

        // set null/empty
View Full Code Here

        assertArrayEquals(new PropertyEditorRegistrar[0], getRegisrarsSupport().getPropertyEditorRegistrars());
    }

    @Test
    public void registerCustomEditors() {
        PropertyEditorRegistrar registrar = new MyPropertyEditorRegistrar();
        formConfig.setPropertyEditorRegistrars(new PropertyEditorRegistrar[] { registrar });

        SimpleTypeConverter registry = new SimpleTypeConverter();
        formConfig.getPropertyEditorRegistrar().registerCustomEditors(registry);
View Full Code Here

TOP

Related Classes of org.springframework.beans.PropertyEditorRegistrar

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.