context.set(fetchPath(), obj);
Map<String, ?> map = (Map<String, ?>) model;
JsonEntity jen = Json.getEntity(mirror);
for (String key : map.keySet()) {
JsonEntityField jef = jen.getField(key);
if (jef == null) {
continue;
}
Object val = map.get(jef.getName());
if (val == null) {
continue;
}
if (isLeaf(val)) {
if (val instanceof El) {
val = ((El) val).eval(context);
}
// zzh@2012-09-14: 暂时去掉 createBy 吧
// jef.setValue(obj, Castors.me().castTo(jef.createValue(obj,
// val, null), Lang.getTypeClass(jef.getGenericType())));
// jef.setValue(obj, jef.createValue(obj, val, null));
jef.setValue(obj, Mapl.maplistToObj(val, jef.getGenericType()));
continue;
} else {
path.push(key);
// jef.setValue(obj, Mapl.maplistToObj(val,
// me.getGenericsType(0)));
jef.setValue(obj, Mapl.maplistToObj(val, jef.getGenericType()));
// zzh@2012-09-14: 暂时去掉 createBy 吧
// jef.setValue(obj, jef.createValue(obj, val,
// me.getGenericsType(0)));
}
}