Package org.springframework.beans.factory.support

Examples of org.springframework.beans.factory.support.PropertiesBeanDefinitionReader.loadBeanDefinitions()


                config = getRestletContext().getClientDispatcher().handle(
                        new Request(Method.GET, ref)).getEntity();

                if (config != null) {
                    propReader = new PropertiesBeanDefinitionReader(this);
                    propReader.loadBeanDefinitions(new SpringResource(config));
                }
            }

            // Then, read the bean definitions from XML representations
            XmlBeanDefinitionReader xmlReader = null;
View Full Code Here


    this.sac = new StaticApplicationContext(parent);
    sac.registerSingleton("beanThatListens", BeanThatListens.class, new MutablePropertyValues());
    sac.registerSingleton("aca", ACATest.class, new MutablePropertyValues());
    sac.registerPrototype("aca-prototype", ACATest.class, new MutablePropertyValues());
    PropertiesBeanDefinitionReader reader = new PropertiesBeanDefinitionReader(sac.getDefaultListableBeanFactory());
    reader.loadBeanDefinitions(new ClassPathResource("testBeans.properties", getClass()));
    sac.refresh();
    sac.addListener(listener);

    sac.getStaticMessageSource().addMessage("code2", Locale.getDefault(), "message2");
View Full Code Here

    sac.registerSingleton("aca", ACATest.class, new MutablePropertyValues());

    sac.registerPrototype("aca-prototype", ACATest.class, new MutablePropertyValues());

    PropertiesBeanDefinitionReader reader = new PropertiesBeanDefinitionReader(sac.getDefaultListableBeanFactory());
    reader.loadBeanDefinitions(new ClassPathResource("testBeans.properties", getClass()));
    sac.refresh();
    sac.addListener(listener);

    StaticMessageSource messageSource = sac.getStaticMessageSource();
    Map usMessages = new HashMap(3);
View Full Code Here

    sac.registerSingleton("beanThatListens", BeanThatListens.class, new MutablePropertyValues());
    sac.registerSingleton("aca", ACATest.class, new MutablePropertyValues());
    sac.registerPrototype("aca-prototype", ACATest.class, new MutablePropertyValues());
    PropertiesBeanDefinitionReader reader = new PropertiesBeanDefinitionReader(sac.getDefaultListableBeanFactory());
    Resource resource = new ClassPathResource("testBeans.properties", getClass());
    reader.loadBeanDefinitions(new EncodedResource(resource, "ISO-8859-1"));
    sac.refresh();
    sac.addListener(listener);

    sac.getStaticMessageSource().addMessage("code2", Locale.getDefault(), "message2");
View Full Code Here

  public void testConfigureExporterParametersWithEncodingFromPropertiesFile() throws Exception {
    GenericWebApplicationContext ac = new GenericWebApplicationContext();
    ac.setServletContext(new MockServletContext());
    BeanDefinitionReader reader = new PropertiesBeanDefinitionReader(ac);
    reader.loadBeanDefinitions(new ClassPathResource("view.properties", getClass()));
    ac.refresh();

    AbstractJasperReportsView view = (AbstractJasperReportsView) ac.getBean("report");
    String encoding = (String) view.getConvertedExporterParameters().get(JRHtmlExporterParameter.CHARACTER_ENCODING);
    assertEquals("UTF-8", encoding);
View Full Code Here

    this.sac = new StaticApplicationContext(parent);
    sac.registerSingleton("beanThatListens", BeanThatListens.class, new MutablePropertyValues());
    sac.registerSingleton("aca", ACATester.class, new MutablePropertyValues());
    sac.registerPrototype("aca-prototype", ACATester.class, new MutablePropertyValues());
    PropertiesBeanDefinitionReader reader = new PropertiesBeanDefinitionReader(sac.getDefaultListableBeanFactory());
    reader.loadBeanDefinitions(new ClassPathResource("testBeans.properties", getClass()));
    sac.refresh();
    sac.addApplicationListener(listener);

    sac.getStaticMessageSource().addMessage("code2", Locale.getDefault(), "message2");
View Full Code Here

  @Test
  public void testConfigureExporterParametersWithEncodingFromPropertiesFile() throws Exception {
    GenericWebApplicationContext ac = new GenericWebApplicationContext();
    ac.setServletContext(new MockServletContext());
    BeanDefinitionReader reader = new PropertiesBeanDefinitionReader(ac);
    reader.loadBeanDefinitions(new ClassPathResource("view.properties", getClass()));
    ac.refresh();

    AbstractJasperReportsView view = (AbstractJasperReportsView) ac.getBean("report");
    String encoding = (String) view.getConvertedExporterParameters().get(JRHtmlExporterParameter.CHARACTER_ENCODING);
    assertEquals("UTF-8", encoding);
View Full Code Here

    sac.registerSingleton("beanThatListens", BeanThatListens.class, new MutablePropertyValues());
    sac.registerSingleton("aca", ACATester.class, new MutablePropertyValues());
    sac.registerPrototype("aca-prototype", ACATester.class, new MutablePropertyValues());
    PropertiesBeanDefinitionReader reader = new PropertiesBeanDefinitionReader(sac.getDefaultListableBeanFactory());
    Resource resource = new ClassPathResource("testBeans.properties", getClass());
    reader.loadBeanDefinitions(new EncodedResource(resource, "ISO-8859-1"));
    sac.refresh();
    sac.addApplicationListener(listener);

    sac.getStaticMessageSource().addMessage("code2", Locale.getDefault(), "message2");
View Full Code Here

    sac.registerSingleton("aca", ACATester.class, new MutablePropertyValues());

    sac.registerPrototype("aca-prototype", ACATester.class, new MutablePropertyValues());

    PropertiesBeanDefinitionReader reader = new PropertiesBeanDefinitionReader(sac.getDefaultListableBeanFactory());
    reader.loadBeanDefinitions(new ClassPathResource("testBeans.properties", getClass()));
    sac.refresh();
    sac.addApplicationListener(listener);

    StaticMessageSource messageSource = sac.getStaticMessageSource();
    Map<String, String> usMessages = new HashMap<String, String>(3);
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.