天天看點

将Map中對應的key和value指派到對象中

BeanUtils位于import org.apache.commons.beanutils.BeanUtils包下

其使用方法:

Map<String, Object> objectMap=new HashMap<String, Object>()

try {

  BeanUtils.populate(corpusTranscribePage, objectMap);//将Map中對應的key和value指派到corpusTranscribePage對象中

} catch (IllegalAccessException | InvocationTargetException e) {

  log.error("轉換異常", e);

}