All Downloads are FREE. Search and download functionalities are using the official Maven repository.

jodd.bean.loader.MapBeanLoader Maven / Gradle / Ivy

There is a newer version: 5.1.6
Show newest version
// Copyright (c) 2003-2013, Jodd Team (jodd.org). All Rights Reserved.

package jodd.bean.loader;

import java.util.Map;

/**
 * Populate java bean using implementation of Map.
 * 

* For each key of Map, it's toString method * is called to get property name. */ public class MapBeanLoader extends BaseBeanLoader { @SuppressWarnings({"unchecked"}) public void load(Object bean, Object source) { if (source instanceof Map) { Map map = (Map) source; for (Map.Entry entry : map.entrySet()) { String name = entry.getKey().toString(); Object value = entry.getValue(); setProperty(bean, name, value); } } } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy