コード例 #1
0
 public Object getValue(String name) {
   PropertyTokenizer prop = new PropertyTokenizer(name);
   if (prop.hasNext()) {
     org.apache.ibatis.reflection.MetaObject metaValue =
         metaObjectForProperty(prop.getIndexedName());
     if (metaValue == SystemMetaObject.NULL_META_OBJECT) {
       return null;
     } else {
       return metaValue.getValue(prop.getChildren());
     }
   } else {
     return objectWrapper.get(prop);
   }
 }
コード例 #2
0
 public void setValue(String name, Object value) {
   PropertyTokenizer prop = new PropertyTokenizer(name);
   if (prop.hasNext()) {
     org.apache.ibatis.reflection.MetaObject metaValue =
         metaObjectForProperty(prop.getIndexedName());
     if (metaValue == SystemMetaObject.NULL_META_OBJECT) {
       if (value == null && prop.getChildren() != null) {
         return; // don't instantiate child path if value is null
       } else {
         metaValue = objectWrapper.instantiatePropertyValue(name, prop, objectFactory);
       }
     }
     metaValue.setValue(prop.getChildren(), value);
   } else {
     objectWrapper.set(prop, value);
   }
 }