Spring Framework MutablePropertyValues - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Spring Framework MutablePropertyValues class.

This code example shows how to use the following methods:add
	} 
 
	@Test
	public void testPropertyPlaceholderConfigurerWithMultiLevelCircularReference() { 
		StaticApplicationContext ac = new StaticApplicationContext();
		MutablePropertyValues pvs = new MutablePropertyValues();
		pvs.add("name", "name${var}");
		ac.registerSingleton("tb1", TestBean.class, pvs);
		pvs = new MutablePropertyValues();
		pvs.add("properties", "var=${m}var\nm=${var2}\nvar2=${var}");
		ac.registerSingleton("configurer1", PropertyPlaceholderConfigurer.class, pvs);
		try { 
			ac.refresh();
			fail("Should have thrown BeanDefinitionStoreException"); 
		} 
		catch (BeanDefinitionStoreException ex) {
			// expected 
		} 
	} 
 
7
CodeRank
This code example shows how to use the following methods:getPropertyValue
This code example shows how to use the following methods:add
 
	private static final class MyApplicationContext extends StaticPortletApplicationContext { 
 
		@Override 
		public void refresh() throws BeansException { 
			MutablePropertyValues pvs = new MutablePropertyValues(); 
			pvs.add("portletClass", MyPortlet.class); 
			registerSingleton(PORTLET_WRAPPING_CONTROLLER_BEAN_NAME, PortletWrappingController.class, pvs); 
			super.refresh(); 
		} 
	} 
 
} 
7
CodeRank
This code example shows how to use the following methods:
This code example shows how to use the following methods:add
			StaticApplicationContext parent = new StaticApplicationContext();
			parent.refresh();
			ac.setParent(parent);
		} 
 
		MutablePropertyValues pvs = new MutablePropertyValues();
		String basepath = "org/springframework/context/support/";
		String[] basenames;
		if (reloadable) {
			basenames = new String[] {
					"classpath:" + basepath + "messages",
					"classpath:" + basepath + "more-messages"};
		} 
		else { 
			basenames = new String[] {
					basepath + "messages",
					basepath + "more-messages"};
		} 
		pvs.add("basenames", basenames);
		if (!fallbackToSystemLocale) {

6
CodeRank
This code example shows how to use the following methods:addPropertyValue
        assertEquals("15/02/2012", dateFormat.format(info.getAttachmentDate()));
    } 
 
    @Test
    public void testBindMapNestedList() throws Exception {
        MutablePropertyValues values = new MutablePropertyValues();
        values.addPropertyValue("resultsMap['USERACTION']", "RELEASE");
        values.addPropertyValue("resultsMap['ATTACHMENTS'][0].attachSequence", "1");
        values.addPropertyValue("resultsMap['ATTACHMENTS'][0].attachStatus", "var_status");
        values.addPropertyValue("resultsMap['ATTACHMENTS'][0].attachmentID", "var_attachmentID");
        values.addPropertyValue("resultsMap['ATTACHMENTS'][0].attachmentDate", "15/02/2012");
 
        org.jboss.processFlow.console.binding.spring.InternalMapBean target = new org.jboss.processFlow.console.binding.spring.InternalMapBean();
        HashMap<String, Object> sourceMap = new HashMap<String, Object>();
        sourceMap.put("MAINCASEID", null);
        sourceMap.put("USERACTION", "INIT");
        sourceMap.put("ATTACHMENTS",
                ListUtils.lazyList(new ArrayList(), FactoryUtils.instantiateFactory(AttachmentInfo.class)));
        target.setResultsMap(sourceMap);
 
5
CodeRank
This code example shows how to use the following methods:
		DefaultPropertyEditorRegistrar mapper = new DefaultPropertyEditorRegistrar();
		mapper.setCustomEditors(Collections.singletonMap("java.lang.Long", new CustomNumberEditor(Long.class, true)));
		BeanWithIntArray result = new BeanWithIntArray();
		BeanWrapperImpl wrapper = new BeanWrapperImpl(result);
		mapper.registerCustomEditors(wrapper);
		wrapper.setPropertyValues(new MutablePropertyValues(Collections.singletonMap("number", "123")));
		assertEquals(123L, result.number);
 
	} 
 
	@Test(expected = IllegalArgumentException.class)
	public void testSetCustomEditorsWithInvalidType() throws Exception {
 
		DefaultPropertyEditorRegistrar mapper = new DefaultPropertyEditorRegistrar();
		mapper.setCustomEditors(Collections.singletonMap(new Object(), new CustomNumberEditor(Long.class, true)));
	} 
 
	@SuppressWarnings("unused") 
	private static class BeanWithIntArray { 
		private int[] numbers;
5
CodeRank
This code example shows how to use the following methods:addPropertyValue
   * </ul> 
   *  
   * @return all the properties stored in this object. 
   */ 
  public MutablePropertyValues getAllProperties() {
    MutablePropertyValues allPropertyValues = new MutablePropertyValues();
    allPropertyValues.addPropertyValue(getCacheKeyGeneratorProperty());
    allPropertyValues.addPropertyValue(getCacheProviderFacadeProperty());
    allPropertyValues.addPropertyValue(getCachingListenersProperty());
    allPropertyValues.addPropertyValue(getCachingModelsProperty());
    allPropertyValues.addPropertyValue(getFlushingModelsProperty());
 
    return allPropertyValues;
  } 
 
  public PropertyValue getCacheKeyGeneratorProperty() {
    return new PropertyValue("cacheKeyGenerator", cacheKeyGenerator);
  } 
   
  public PropertyValue getCacheProviderFacadeProperty() {
5
CodeRank
This code example shows how to use the following methods:add
		assertEquals("12:00:00 PM", binder.getBindingResult().getFieldValue("localTimeAnnotated"));
	} 
 
	@Test
	public void testBindLocalTimeFromJavaUtilCalendar() throws Exception {
		MutablePropertyValues propertyValues = new MutablePropertyValues();
		propertyValues.add("localTime", new GregorianCalendar(1970, 0, 0, 12, 0));
		binder.bind(propertyValues);
		assertEquals(0, binder.getBindingResult().getErrorCount());
		assertEquals("12:00 PM", binder.getBindingResult().getFieldValue("localTime"));
	} 
 
	@Test
	public void testBindLocalDateTime() { 
		MutablePropertyValues propertyValues = new MutablePropertyValues();
		propertyValues.add("localDateTime", "10/31/09 12:00 PM");
		binder.bind(propertyValues);
		assertEquals(0, binder.getBindingResult().getErrorCount());
		assertEquals("10/31/09 12:00 PM", binder.getBindingResult().getFieldValue("localDateTime"));
	} 
5
CodeRank
This code example shows how to use the following methods:addPropertyValue
See Code Examples for Spring Framework MutablePropertyValues Methods: