writers = new HashMap<String, BeanEventPropertyWriter>();
writersMap.put(beanClass, writers);
FastClass fastClass = FastClass.create(Thread.currentThread().getContextClassLoader(), beanClass);
for (WriteablePropertyDescriptor prop : props) {
FastMethod writerMethod = fastClass.getMethod(prop.getWriteMethod());
writers.put(prop.getPropertyName(), new BeanEventPropertyWriter(beanClass, writerMethod));
}
// populate writers
}
beanToSend = beanClass.newInstance();
for (Map.Entry<String, Object> entry : mapToSend.entrySet()) {
BeanEventPropertyWriter writer = writers.get(entry.getKey());
if (writer != null) {
writer.writeValue(entry.getValue(), beanToSend);
}
}
}
catch (Exception e) {
throw new EPException("Cannot populate bean instance", e);