Examples of addPropertyEditorRegistrar()


Examples of org.springframework.beans.factory.support.DefaultListableBeanFactory.addPropertyEditorRegistrar()

  public void setUp() throws Exception {
    Assume.group(TestGroup.PERFORMANCE);

    DefaultListableBeanFactory factory = new DefaultListableBeanFactory();
    new XmlBeanDefinitionReader(factory).loadBeanDefinitions(CONTEXT);
    factory.addPropertyEditorRegistrar(new PropertyEditorRegistrar() {
      @Override
      public void registerCustomEditors(PropertyEditorRegistry registry) {
        registry.registerCustomEditor(Date.class, new CustomDateEditor((DateFormat) DATE_FORMAT.clone(), false));
      }
    });
View Full Code Here

Examples of org.springframework.beans.factory.support.DefaultListableBeanFactory.addPropertyEditorRegistrar()

  }

  @Test
  public void testCustomEditor() {
    DefaultListableBeanFactory lbf = new DefaultListableBeanFactory();
    lbf.addPropertyEditorRegistrar(new PropertyEditorRegistrar() {
      @Override
      public void registerCustomEditors(PropertyEditorRegistry registry) {
        NumberFormat nf = NumberFormat.getInstance(Locale.GERMAN);
        registry.registerCustomEditor(Float.class, new CustomNumberEditor(Float.class, nf, true));
      }
View Full Code Here

Examples of org.springframework.beans.factory.support.DefaultListableBeanFactory.addPropertyEditorRegistrar()

  }

  @Test
  public void testCustomEditorWithBeanReference() {
    DefaultListableBeanFactory lbf = new DefaultListableBeanFactory();
    lbf.addPropertyEditorRegistrar(new PropertyEditorRegistrar() {
      @Override
      public void registerCustomEditors(PropertyEditorRegistry registry) {
        NumberFormat nf = NumberFormat.getInstance(Locale.GERMAN);
        registry.registerCustomEditor(Float.class, new CustomNumberEditor(Float.class, nf, true));
      }
View Full Code Here

Examples of org.springframework.beans.factory.xml.XmlBeanFactory.addPropertyEditorRegistrar()

    return (LogFormat) beanFactory.getBean("logFormat");
  }

  public static ConfigurableListableBeanFactory loadBeanFactory(Resource r) throws Exception {
    XmlBeanFactory beanFactory = new XmlBeanFactory(r);
    beanFactory.addPropertyEditorRegistrar(new KoljaPropertyEditorRegistrar());

    return new GenericApplicationContext(beanFactory).getBeanFactory();
  }

  public static ConfigurableListableBeanFactory loadBeanFactory(String string) throws Exception {
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.