Package org.nutz.json.entity

Examples of org.nutz.json.entity.JsonEntityField


        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)));
            }
        }
View Full Code Here

TOP

Related Classes of org.nutz.json.entity.JsonEntityField

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.