List of usage examples for org.apache.commons.beanutils Person getAge
public int getAge()
From source file:org.seasar.struts.bean.SuppressPropertyUtilsBeanTest.java
public void testBeanUtilsBean_default_populate() throws Exception { BeanUtilsBean beanUtils = new BeanUtilsBean(); Person person = new Person(); Map properties = new HashMap(); properties.put("fullName.firstName", "aaa"); properties.put("fullName.lastName", "bbb"); properties.put("address.street", "ccc"); properties.put("age", "20"); beanUtils.populate(person, properties); assertEquals("aaa", person.getFullName().getFirstName()); assertEquals("bbb", person.getFullName().getLastName()); assertEquals("ccc", person.getAddress().getStreet()); assertEquals("20", person.getAge()); }
From source file:org.seasar.struts.bean.SuppressPropertyUtilsBeanTest.java
public void testBeanUtilsBean_suppressed_populate() throws Exception { List classes = new ArrayList(); classes.add(FullName.class); BeanUtilsBean beanUtils = new BeanUtilsBean(new ConvertUtilsBean(), new SuppressPropertyUtilsBean(classes)); Person person = new Person(); Map properties = new HashMap(); properties.put("fullName.firstName", "aaa"); properties.put("fullName.lastName", "bbb"); properties.put("address.street", "ccc"); properties.put("age", "20"); beanUtils.populate(person, properties); assertNull(person.getFullName().getFirstName()); assertNull(person.getFullName().getLastName()); assertEquals("ccc", person.getAddress().getStreet()); assertEquals("20", person.getAge()); }