Java Code Examples for net.sf.ehcache.hibernate.management.impl.BeanUtils#getBeanProperty()

The following examples show how to use net.sf.ehcache.hibernate.management.impl.BeanUtils#getBeanProperty() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: AbstractReportModelGenerater.java    From bdf3 with Apache License 2.0 6 votes vote down vote up
@SuppressWarnings({ "rawtypes", "unchecked" })
private Object calculateBeanPropertyData(String[] columnNames, Map<String, Object> map) throws Exception {
	Object obj = map.get(columnNames[0]);
	if(obj==null){
		return null;
	}
	if (columnNames.length == 1) {
		return obj;
	} else if (columnNames.length == 2) {
		return BeanUtils.getBeanProperty(obj, columnNames[1]);
	} else {
		Map subMap = PropertyUtils.describe(obj);
		List<String> list = new ArrayList<String>();
		int i = 1;
		while (i < columnNames.length) {
			list.add(columnNames[i]);
			i++;
		}
		String[] array = list.toArray(new String[list.size()]);
		return calculateBeanPropertyData(array, subMap);
	}
}
 
Example 2
Source File: Lists.java    From web-flash with MIT License 4 votes vote down vote up
private static Object getProperty(Object bean,String name){
    return BeanUtils.getBeanProperty(bean,name);
}
 
Example 3
Source File: Lists.java    From flash-waimai with MIT License 4 votes vote down vote up
private static Object getProperty(Object bean,String name){
    return BeanUtils.getBeanProperty(bean,name);
}