protected Object build(String key) throws Exception { Object bean = newInstance(map.get(key)); Map<String, String> attributes = attributesByBeanRef(key); if (!attributes.isEmpty()) { for (Entry<String, String> e : attributes.entrySet()) { final String v = e.getValue(); BeanUtils.setProperty(bean, e.getKey(), v.startsWith(BEAN_ID_PREFIX) ? get(v) : v); } } return bean; }