List of usage examples for org.apache.commons.beanutils PropertyUtilsBean setIndexedProperty
public void setIndexedProperty(Object bean, String name, int index, Object value) throws IllegalAccessException, InvocationTargetException, NoSuchMethodException
From source file:com.linkedin.databus.core.util.ConfigLoader.java
private void fillPropertyFromList(Object bean, String propName, List<?> values) throws IllegalAccessException, InvocationTargetException, NoSuchMethodException { PropertyUtilsBean propUtils = _beanUtilsBean.getPropertyUtils(); int idx = 0;/*from w w w . j av a 2 s . c om*/ for (Object elem : values) { if (elem instanceof Map<?, ?>) { Object subBean = propUtils.getIndexedProperty(bean, propName, idx); fillBeanFromMap(subBean, (Map<?, ?>) elem); } else { propUtils.setIndexedProperty(bean, propName, idx, elem); } ++idx; } }