package com.huigou.uasp.form.pojo.analysis;

import java.util.List;

import net.sf.ezmorph.bean.MorphDynaBean;

import com.huigou.uasp.form.pojo.Options;
import com.huigou.uasp.form.pojo.Root;
import com.huigou.uasp.form.pojo.TableColumns;
import com.huigou.uasp.util.ReflectionUtil;

public class GetRootDefault implements AttributeTypeInter{

	@Override
	public Root getRootByAttrName(String attrName,Root root,
		  MorphDynaBean bean, List<TableColumns> tableColumnsList) {
		  Object attrVal = bean.get(attrName);//属性值
         if(attrVal!=null&&!"null".equals(attrVal.toString().trim())){
   	        System.out.println("attrVal===="+attrName+":"+attrVal);
   	       if (ReflectionUtil.getSetMethod(root.getClass(),attrName)!=null){
   	          ReflectionUtil.invokeSet(root, attrName, attrVal);
   	        }
         } 
   	      return root;
	}

}
