code: public static Object convertMapToBean(Map<String, ? extends Object> source, Class<?> target) throws ConversionException {
          Object bean = newInstance(target);
          if (bean == null) {
              //try with just the target name as specified in Trac #352
              bean = newInstance(target.getName());
              if (bean == null) {
                  throw new ConversionException("Unable to create bean using empty constructor");
              }
          }
          try {
              BeanUtils.populate(bean, source);
          } catch (Exception e) {
              throw new ConversionException("Error populating bean", e);
          }
          return bean;
      }
docs: Convert map to bean
  
  @param source
  Source map
  @param target
  Target class
  @return Bean of that class
  @throws ConversionException
  on failure