package com.huigou.uasp.form.controller;

import java.util.ArrayList;
import java.util.List;

import org.apache.commons.beanutils.DynaProperty;

import net.sf.ezmorph.bean.MorphDynaBean;
import net.sf.json.JSONObject;

import com.alibaba.fastjson.JSON;
import com.huigou.uasp.form.pojo.Event;
import com.huigou.uasp.form.pojo.Options;
import com.huigou.uasp.form.pojo.Root;
import com.huigou.uasp.form.pojo.RootBean;
import com.huigou.uasp.form.pojo.TableColumns;
import com.huigou.uasp.form.pojo.TableOptions;
import com.huigou.uasp.form.pojo.analysis.AttributeTypeInter;
import com.huigou.uasp.form.pojo.analysis.GetRootDefault;
import com.huigou.uasp.form.pojo.analysis.GetRootEvent;
import com.huigou.uasp.form.pojo.analysis.GetRootFormColumns;
import com.huigou.uasp.form.pojo.analysis.GetRootOptions;
import com.huigou.uasp.form.pojo.analysis.GetRootRules;
import com.huigou.uasp.form.pojo.analysis.GetRootTableColumns;
import com.huigou.uasp.util.Constant;
import com.huigou.uasp.util.ReflectionUtil;
import com.huigou.uasp.util.Utils;

public class TestClass {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
      String ds="{\"list\":[{\"type\":\"table\",\"icon\":\"icon-table\",\"options\":{\"defaultValue\":[],\"customClass\":\"\",\"labelWidth\":100,\"isLabelWidth\":false,\"hidden\":false,\"dataBind\":true,\"disabled\":false,\"required\":false,\"remoteFunc\":\"func_1592183795541\",\"remoteOption\":\"option_1592183795541\"},\"tableColumns\":[{\"type\":\"input\",\"icon\":\"icon-input\",\"options\":{\"width\":\"200px\",\"defaultValue\":\"\",\"required\":false,\"requiredMessage\":\"\",\"dataType\":\"\",\"dataTypeCheck\":false,\"dataTypeMessage\":\"\",\"pattern\":\"\",\"patternCheck\":false,\"patternMessage\":\"\",\"placeholder\":\"\",\"customClass\":\"\",\"disabled\":false,\"labelWidth\":100,\"isLabelWidth\":false,\"hidden\":false,\"dataBind\":true,\"showPassword\":false,\"remoteFunc\":\"func_1592183804092\",\"remoteOption\":\"option_1592183804092\",\"tableColumn\":true},\"event\":{\"blur\":\"\",\"change\":\"\"},\"name\":\"  预算编号\",\"novalid\":{},\"key\":\"1592183804092\",\"model\":\"input_1592183804092\",\"rules\":[]},{\"type\":\"input\",\"icon\":\"icon-input\",\"options\":{\"width\":\"200px\",\"defaultValue\":\"\",\"required\":false,\"requiredMessage\":\"\",\"dataType\":\"\",\"dataTypeCheck\":false,\"dataTypeMessage\":\"\",\"pattern\":\"\",\"patternCheck\":false,\"patternMessage\":\"\",\"placeholder\":\"\",\"customClass\":\"\",\"disabled\":false,\"labelWidth\":100,\"isLabelWidth\":false,\"hidden\":false,\"dataBind\":true,\"showPassword\":false,\"remoteFunc\":\"func_1592183830591\",\"remoteOption\":\"option_1592183830591\",\"tableColumn\":true},\"event\":{\"blur\":\"\",\"change\":\"\"},\"name\":\"预算名称\",\"novalid\":{},\"key\":\"1592183830591\",\"model\":\"input_1592183830591\",\"rules\":[]},{\"type\":\"input\",\"icon\":\"icon-input\",\"options\":{\"width\":\"200px\",\"defaultValue\":\"\",\"required\":false,\"requiredMessage\":\"\",\"dataType\":\"\",\"dataTypeCheck\":false,\"dataTypeMessage\":\"\",\"pattern\":\"\",\"patternCheck\":false,\"patternMessage\":\"\",\"placeholder\":\"\",\"customClass\":\"\",\"disabled\":false,\"labelWidth\":100,\"isLabelWidth\":false,\"hidden\":false,\"dataBind\":true,\"showPassword\":false,\"remoteFunc\":\"func_1592183846416\",\"remoteOption\":\"option_1592183846416\",\"tableColumn\":true},\"event\":{\"blur\":\"\",\"change\":\"\"},\"name\":\"数量\",\"novalid\":{},\"key\":\"1592183846416\",\"model\":\"input_1592183846416\",\"rules\":[]},{\"type\":\"input\",\"icon\":\"icon-input\",\"options\":{\"width\":\"200px\",\"defaultValue\":\"\",\"required\":false,\"requiredMessage\":\"\",\"dataType\":\"\",\"dataTypeCheck\":false,\"dataTypeMessage\":\"\",\"pattern\":\"\",\"patternCheck\":false,\"patternMessage\":\"\",\"placeholder\":\"\",\"customClass\":\"\",\"disabled\":false,\"labelWidth\":100,\"isLabelWidth\":false,\"hidden\":false,\"dataBind\":true,\"showPassword\":false,\"remoteFunc\":\"func_1592183862642\",\"remoteOption\":\"option_1592183862642\",\"tableColumn\":true},\"event\":{\"blur\":\"\",\"change\":\"\"},\"name\":\"金额\",\"novalid\":{},\"key\":\"1592183862642\",\"model\":\"input_1592183862642\",\"rules\":[]},{\"type\":\"input\",\"icon\":\"icon-input\",\"options\":{\"width\":\"200px\",\"defaultValue\":\"\",\"required\":false,\"requiredMessage\":\"\",\"dataType\":\"\",\"dataTypeCheck\":false,\"dataTypeMessage\":\"\",\"pattern\":\"\",\"patternCheck\":false,\"patternMessage\":\"\",\"placeholder\":\"\",\"customClass\":\"\",\"disabled\":false,\"labelWidth\":100,\"isLabelWidth\":false,\"hidden\":false,\"dataBind\":true,\"showPassword\":false,\"remoteFunc\":\"func_1592183959895\",\"remoteOption\":\"option_1592183959895\",\"tableColumn\":true},\"event\":{\"blur\":\"\",\"change\":\"\"},\"name\":\"规格型号\",\"novalid\":{},\"key\":\"1592183959895\",\"model\":\"规格型号\",\"rules\":[]}],\"name\":\"\",\"key\":\"1592183795541\",\"model\":\"table_1592183795541\",\"rules\":[]},{\"type\":\"grid\",\"icon\":\"icon-RectangleCopy\",\"columns\":[{\"span\":12,\"xs\":12,\"sm\":12,\"md\":12,\"lg\":12,\"xl\":12,\"list\":[{\"type\":\"input\",\"icon\":\"icon-input\",\"options\":{\"width\":\"100%\",\"defaultValue\":\"\",\"required\":false,\"requiredMessage\":\"\",\"dataType\":\"\",\"dataTypeCheck\":false,\"dataTypeMessage\":\"\",\"pattern\":\"\",\"patternCheck\":false,\"patternMessage\":\"\",\"placeholder\":\"\",\"customClass\":\"\",\"disabled\":false,\"labelWidth\":100,\"isLabelWidth\":false,\"hidden\":false,\"dataBind\":true,\"showPassword\":false,\"remoteFunc\":\"func_1592184027111\",\"remoteOption\":\"option_1592184027111\"},\"event\":{\"blur\":\"\",\"change\":\"\"},\"name\":\"项目名称\",\"novalid\":{},\"key\":\"1592184027111\",\"model\":\"input_1592184027111\",\"rules\":[]},{\"type\":\"date\",\"icon\":\"icon-date\",\"options\":{\"defaultValue\":\"\",\"readonly\":false,\"disabled\":false,\"editable\":true,\"clearable\":true,\"placeholder\":\"\",\"startPlaceholder\":\"\",\"endPlaceholder\":\"\",\"type\":\"date\",\"format\":\"yyyy-MM-dd\",\"timestamp\":false,\"required\":false,\"requiredMessage\":\"\",\"width\":\"\",\"customClass\":\"\",\"labelWidth\":100,\"isLabelWidth\":false,\"hidden\":false,\"dataBind\":true,\"remoteFunc\":\"func_1592184176333\",\"remoteOption\":\"option_1592184176333\"},\"event\":{\"change\":\"\"},\"name\":\"交付日期\",\"key\":\"1592185088088\",\"model\":\"date_1592184176333\",\"rules\":[],\"novalid\":{}},{\"type\":\"select\",\"icon\":\"icon-select\",\"options\":{\"defaultValue\":\"\",\"multiple\":false,\"disabled\":false,\"clearable\":false,\"placeholder\":\"\",\"required\":false,\"requiredMessage\":\"\",\"showLabel\":false,\"width\":\"\",\"options\":[{\"value\":\"Option 1\"},{\"value\":\"Option 2\"},{\"value\":\"Option 3\"}],\"remote\":false,\"remoteType\":\"dictionary\",\"dictionary\":\"\",\"filterable\":false,\"remoteOptions\":[],\"props\":{\"value\":\"value\",\"label\":\"label\"},\"list\":\"\",\"customClass\":\"\",\"labelWidth\":100,\"isLabelWidth\":false,\"hidden\":false,\"dataBind\":true,\"remoteFunc\":\"func_1592184096187\",\"remoteOption\":\"option_1592184096187\"},\"event\":{\"change\":\"\"},\"name\":\"采购类型\",\"key\":\"1592184216605\",\"model\":\"select_1592184096187\",\"rules\":[],\"novalid\":{}}]},{\"span\":12,\"xs\":12,\"sm\":12,\"md\":12,\"lg\":12,\"xl\":12,\"list\":[{\"type\":\"input\",\"icon\":\"icon-input\",\"options\":{\"width\":\"100%\",\"defaultValue\":\"\",\"required\":false,\"requiredMessage\":\"\",\"dataType\":\"\",\"dataTypeCheck\":false,\"dataTypeMessage\":\"\",\"pattern\":\"\",\"patternCheck\":false,\"patternMessage\":\"\",\"placeholder\":\"\",\"customClass\":\"\",\"disabled\":false,\"labelWidth\":100,\"isLabelWidth\":false,\"hidden\":false,\"dataBind\":true,\"showPassword\":false,\"remoteFunc\":\"func_1592184045106\",\"remoteOption\":\"option_1592184045106\"},\"event\":{\"blur\":\"\",\"change\":\"\"},\"name\":\"系统\",\"novalid\":{},\"key\":\"1592184045106\",\"model\":\"input_1592184045106\",\"rules\":[]}]}],\"options\":{\"gutter\":0,\"justify\":\"start\",\"align\":\"top\",\"customClass\":\"\",\"hidden\":false,\"flex\":true,\"responsive\":false,\"remoteFunc\":\"func_1592184014765\",\"remoteOption\":\"option_1592184014765\"},\"name\":\"栅格布局\",\"key\":\"1592184014765\",\"model\":\"grid_1592184014765\",\"rules\":[]}],\"config\":{\"labelWidth\":100,\"labelPosition\":\"right\",\"size\":\"small\",\"customClass\":\"\",\"ui\":\"element\",\"layout\":\"horizontal\",\"labelCol\":3,\"width\":\"100%\"}}";
      
		 System.out.println("length=="+ds.length());
		 
		 String  paras="{\"list\":[{\"type\":\"table\",\"tablename\":\"SMS_ORDER_DETAIL\",\"icon\":\"icon-table\",\"options\":{\"defaultValue\":[],\"customClass\":\"\",\"labelWidth\":100,\"isLabelWidth\":false,\"hidden\":false,\"dataBind\":true,\"disabled\":false,\"required\":false,\"remoteFunc\":\"func_1592183795541\",\"remoteOption\":\"option_1592183795541\"},\"tableColumns\":[{\"type\":\"input\",\"icon\":\"icon-input\",\"options\":{\"width\":\"200px\",\"defaultValue\":\"\",\"required\":false,\"requiredMessage\":\"\",\"dataType\":\"\",\"dataTypeCheck\":false,\"dataTypeMessage\":\"\",\"pattern\":\"\",\"patternCheck\":false,\"patternMessage\":\"\",\"placeholder\":\"\",\"customClass\":\"\",\"disabled\":false,\"labelWidth\":100,\"isLabelWidth\":false,\"hidden\":false,\"dataBind\":true,\"showPassword\":false,\"remoteFunc\":\"func_1592183804092\",\"remoteOption\":\"option_1592183804092\",\"tableColumn\":true},\"event\":{\"blur\":\"\",\"change\":\"\"},\"name\":\"  预算编号\",\"novalid\":{},\"key\":\"1592183804092\",\"model\":\"input_1592183804092\",\"rules\":[]},{\"type\":\"input\",\"icon\":\"icon-input\",\"options\":{\"width\":\"200px\",\"defaultValue\":\"\",\"required\":false,\"requiredMessage\":\"\",\"dataType\":\"\",\"dataTypeCheck\":false,\"dataTypeMessage\":\"\",\"pattern\":\"\",\"patternCheck\":false,\"patternMessage\":\"\",\"placeholder\":\"\",\"customClass\":\"\",\"disabled\":false,\"labelWidth\":100,\"isLabelWidth\":false,\"hidden\":false,\"dataBind\":true,\"showPassword\":false,\"remoteFunc\":\"func_1592183830591\",\"remoteOption\":\"option_1592183830591\",\"tableColumn\":true},\"event\":{\"blur\":\"\",\"change\":\"\"},\"name\":\"预算名称\",\"novalid\":{},\"key\":\"1592183830591\",\"model\":\"input_1592183830591\",\"rules\":[]},{\"type\":\"input\",\"icon\":\"icon-input\",\"options\":{\"width\":\"200px\",\"defaultValue\":\"\",\"required\":false,\"requiredMessage\":\"\",\"dataType\":\"\",\"dataTypeCheck\":false,\"dataTypeMessage\":\"\",\"pattern\":\"\",\"patternCheck\":false,\"patternMessage\":\"\",\"placeholder\":\"\",\"customClass\":\"\",\"disabled\":false,\"labelWidth\":100,\"isLabelWidth\":false,\"hidden\":false,\"dataBind\":true,\"showPassword\":false,\"remoteFunc\":\"func_1592183846416\",\"remoteOption\":\"option_1592183846416\",\"tableColumn\":true},\"event\":{\"blur\":\"\",\"change\":\"\"},\"name\":\"数量\",\"novalid\":{},\"key\":\"1592183846416\",\"model\":\"input_1592183846416\",\"rules\":[]},{\"type\":\"input\",\"icon\":\"icon-input\",\"options\":{\"width\":\"200px\",\"defaultValue\":\"\",\"required\":false,\"requiredMessage\":\"\",\"dataType\":\"\",\"dataTypeCheck\":false,\"dataTypeMessage\":\"\",\"pattern\":\"\",\"patternCheck\":false,\"patternMessage\":\"\",\"placeholder\":\"\",\"customClass\":\"\",\"disabled\":false,\"labelWidth\":100,\"isLabelWidth\":false,\"hidden\":false,\"dataBind\":true,\"showPassword\":false,\"remoteFunc\":\"func_1592183862642\",\"remoteOption\":\"option_1592183862642\",\"tableColumn\":true},\"event\":{\"blur\":\"\",\"change\":\"\"},\"name\":\"金额\",\"novalid\":{},\"key\":\"1592183862642\",\"model\":\"input_1592183862642\",\"rules\":[]},{\"type\":\"input\",\"icon\":\"icon-input\",\"options\":{\"width\":\"200px\",\"defaultValue\":\"\",\"required\":false,\"requiredMessage\":\"\",\"dataType\":\"\",\"dataTypeCheck\":false,\"dataTypeMessage\":\"\",\"pattern\":\"\",\"patternCheck\":false,\"patternMessage\":\"\",\"placeholder\":\"\",\"customClass\":\"\",\"disabled\":false,\"labelWidth\":100,\"isLabelWidth\":false,\"hidden\":false,\"dataBind\":true,\"showPassword\":false,\"remoteFunc\":\"func_1592183959895\",\"remoteOption\":\"option_1592183959895\",\"tableColumn\":true},\"event\":{\"blur\":\"\",\"change\":\"\"},\"name\":\"规格型号\",\"novalid\":{},\"key\":\"1592183959895\",\"model\":\"规格型号\",\"rules\":[]}],\"name\":\"\",\"key\":\"1592183795541\",\"model\":\"table_1592183795541\",\"rules\":[]},{\"type\":\"grid\",\"icon\":\"icon-RectangleCopy\",\"columns\":[{\"span\":12,\"xs\":12,\"sm\":12,\"md\":12,\"lg\":12,\"xl\":12,\"list\":[{\"type\":\"input\",\"icon\":\"icon-input\",\"options\":{\"width\":\"100%\",\"defaultValue\":\"\",\"required\":false,\"requiredMessage\":\"\",\"dataType\":\"\",\"dataTypeCheck\":false,\"dataTypeMessage\":\"\",\"pattern\":\"\",\"patternCheck\":false,\"patternMessage\":\"\",\"placeholder\":\"\",\"customClass\":\"\",\"disabled\":false,\"labelWidth\":100,\"isLabelWidth\":false,\"hidden\":false,\"dataBind\":true,\"showPassword\":false,\"remoteFunc\":\"func_1592184027111\",\"remoteOption\":\"option_1592184027111\"},\"event\":{\"blur\":\"\",\"change\":\"\"},\"name\":\"项目名称\",\"novalid\":{},\"key\":\"1592184027111\",\"model\":\"input_1592184027111\",\"rules\":[]},{\"type\":\"date\",\"icon\":\"icon-date\",\"options\":{\"defaultValue\":\"\",\"readonly\":false,\"disabled\":false,\"editable\":true,\"clearable\":true,\"placeholder\":\"\",\"startPlaceholder\":\"\",\"endPlaceholder\":\"\",\"type\":\"date\",\"format\":\"yyyy-MM-dd\",\"timestamp\":false,\"required\":false,\"requiredMessage\":\"\",\"width\":\"\",\"customClass\":\"\",\"labelWidth\":100,\"isLabelWidth\":false,\"hidden\":false,\"dataBind\":true,\"remoteFunc\":\"func_1592184176333\",\"remoteOption\":\"option_1592184176333\"},\"event\":{\"change\":\"\"},\"name\":\"交付日期\",\"key\":\"1592185088088\",\"model\":\"date_1592184176333\",\"rules\":[],\"novalid\":{}},{\"type\":\"select\",\"icon\":\"icon-select\",\"options\":{\"defaultValue\":\"\",\"multiple\":false,\"disabled\":false,\"clearable\":false,\"placeholder\":\"\",\"required\":false,\"requiredMessage\":\"\",\"showLabel\":false,\"width\":\"\",\"options\":[{\"value\":\"Option 1\"},{\"value\":\"Option 2\"},{\"value\":\"Option 3\"}],\"remote\":false,\"remoteType\":\"dictionary\",\"dictionary\":\"\",\"filterable\":false,\"remoteOptions\":[],\"props\":{\"value\":\"value\",\"label\":\"label\"},\"list\":\"\",\"customClass\":\"\",\"labelWidth\":100,\"isLabelWidth\":false,\"hidden\":false,\"dataBind\":true,\"remoteFunc\":\"func_1592184096187\",\"remoteOption\":\"option_1592184096187\"},\"event\":{\"change\":\"\"},\"name\":\"采购类型\",\"key\":\"1592184216605\",\"model\":\"select_1592184096187\",\"rules\":[],\"novalid\":{}}]},{\"span\":12,\"xs\":12,\"sm\":12,\"md\":12,\"lg\":12,\"xl\":12,\"list\":[{\"type\":\"input\",\"icon\":\"icon-input\",\"options\":{\"width\":\"100%\",\"defaultValue\":\"\",\"required\":false,\"requiredMessage\":\"\",\"dataType\":\"\",\"dataTypeCheck\":false,\"dataTypeMessage\":\"\",\"pattern\":\"\",\"patternCheck\":false,\"patternMessage\":\"\",\"placeholder\":\"\",\"customClass\":\"\",\"disabled\":false,\"labelWidth\":100,\"isLabelWidth\":false,\"hidden\":false,\"dataBind\":true,\"showPassword\":false,\"remoteFunc\":\"func_1592184045106\",\"remoteOption\":\"option_1592184045106\"},\"event\":{\"blur\":\"\",\"change\":\"\"},\"name\":\"系统\",\"novalid\":{},\"key\":\"1592184045106\",\"model\":\"input_1592184045106\",\"rules\":[]}]}],\"options\":{\"gutter\":0,\"justify\":\"start\",\"align\":\"top\",\"customClass\":\"\",\"hidden\":false,\"flex\":true,\"responsive\":false,\"remoteFunc\":\"func_1592184014765\",\"remoteOption\":\"option_1592184014765\"},\"name\":\"栅格布局\",\"key\":\"1592184014765\",\"model\":\"grid_1592184014765\",\"rules\":[]},{\"type\":\"input\",\"icon\":\"icon-input\",\"options\":{\"width\":\"30%\",\"defaultValue\":\"\",\"required\":false,\"requiredMessage\":\"\",\"dataType\":\"\",\"dataTypeCheck\":false,\"dataTypeMessage\":\"\",\"pattern\":\"\",\"patternCheck\":false,\"patternMessage\":\"\",\"placeholder\":\"\",\"customClass\":\"\",\"disabled\":false,\"labelWidth\":100,\"isLabelWidth\":false,\"hidden\":false,\"dataBind\":true,\"showPassword\":false,\"remoteFunc\":\"func_1592296098724\",\"remoteOption\":\"option_1592296098724\"},\"event\":{\"blur\":\"\",\"change\":\"\"},\"name\":\"单行文本\",\"key\":\"1592296098724\",\"model\":\"input_1592296098724\",\"rules\":[]},{\"type\":\"textarea\",\"icon\":\"icon-diy-com-textarea\",\"options\":{\"width\":\"30%\",\"defaultValue\":\"\",\"required\":false,\"requiredMessage\":\"\",\"disabled\":false,\"pattern\":\"\",\"patternMessage\":\"\",\"placeholder\":\"\",\"customClass\":\"\",\"labelWidth\":100,\"isLabelWidth\":false,\"hidden\":false,\"dataBind\":true,\"remoteFunc\":\"func_1592296110884\",\"remoteOption\":\"option_1592296110884\"},\"event\":{\"blur\":\"\",\"change\":\"\"},\"name\":\"多行文本\",\"key\":\"1592296110884\",\"model\":\"textarea_1592296110884\",\"rules\":[]}],\"config\":{\"labelWidth\":100,\"labelPosition\":\"right\",\"size\":\"small\",\"customClass\":\"\",\"ui\":\"element\",\"layout\":\"horizontal\",\"labelCol\":3,\"width\":\"100%\"}}";
//			{\"type\":\"input\",\"icon\":\"icon-input\",\"options\":{\"width\":\"30%\",\"defaultValue\":\"\",\"required\":false,\"requiredMessage\":\"\",\"dataType\":\"\",\"dataTypeCheck\":false,\"dataTypeMessage\":\"\",\"pattern\":\"\",\"patternCheck\":false,\"patternMessage\":\"\",\"placeholder\":\"\",\"customClass\":\"\",\"disabled\":false,\"labelWidth\":100,\"isLabelWidth\":false,\"hidden\":false,\"dataBind\":true,\"showPassword\":false,\"remoteFunc\":\"func_1592296098724\",\"remoteOption\":\"option_1592296098724\"},\"event\":{\"blur\":\"\",\"change\":\"\"},\"name\":\"单行文本\",\"key\":\"1592296098724\",\"model\":\"input_1592296098724\",\"rules\":[]},{\"type\":\"textarea\",\"icon\":\"icon-diy-com-textarea\",\"options\":{\"width\":\"30%\",\"defaultValue\":\"\",\"required\":false,\"requiredMessage\":\"\",\"disabled\":false,\"pattern\":\"\",\"patternMessage\":\"\",\"placeholder\":\"\",\"customClass\":\"\",\"labelWidth\":100,\"isLabelWidth\":false,\"hidden\":false,\"dataBind\":true,\"remoteFunc\":\"func_1592296110884\",\"remoteOption\":\"option_1592296110884\"},\"event\":{\"blur\":\"\",\"change\":\"\"},\"name\":\"多行文本\",\"key\":\"1592296110884\",\"model\":\"textarea_1592296110884\",\"rules\":[]}

		   //url+="&datas="+paras;
			//  JSONObject json = new JSONObject();
			 
			// String datas=JSON.toJSONString(paras);
			 JSONObject jsonObject = JSONObject.fromObject(paras);
			 RootBean resultInfo = (RootBean) JSONObject.toBean(jsonObject,RootBean.class);
			 
System.out.println("====================");
         List <?>dataList=resultInfo.getList();
         MorphDynaBean mbean=null;
         List<Root> rootList=new ArrayList<Root>();
         Root root=null;
         DynaProperty[]  dynaProperties=null;
         List <TableColumns> tableColumnsList=null;
         for (int i=0;i<dataList.size();i++){
        	 
        	  mbean=(MorphDynaBean)dataList.get(i);
        	  tableColumnsList=new ArrayList<TableColumns>();
        	  root=new Root();
              dynaProperties = mbean.getDynaClass().getDynaProperties();
           
          for(int j=0; j<dynaProperties.length;j++){
              String attrName = dynaProperties[j].getName();//属性名称
          
     	  // System.out.println("attrName==="+attrName);
         
            //  outResults=this.getPageButtonType(paraForm.getBtnMethodNames()[i]);
		//		outResults.processOutResult(sb,btnAttr);
		
              getAttrNameType(attrName).getRootByAttrName(attrName,root,mbean,tableColumnsList);
              
          /*  if  ("tableColumns".equals(attrName)){  //获取表格列配置
        	    tableColumnsList.addAll(getTableColumnsBeans(mbean,"tableColumns"));
          	    root.setTableColumns(tableColumnsList);
         		  
            } else	if  ("columns".equals(attrName)){  //获取表单元素
            
            	   tableColumnsList.addAll(getGridColumnBeans(mbean,"columns"));
            	   root.setTableColumns(tableColumnsList); 
            	   
            }else  if  ("rules".equals(attrName)){
            	
            }else  if  ("options".equals(attrName)){
            	 MorphDynaBean  optionsbean=(MorphDynaBean)mbean.get(attrName);
            	 Options options=new Options();
           		 options=(Options)getEndBean(options,optionsbean,attrName);
          	     ((Root)root).setOptions(options);
          	     
            }else  if  ("event".equals(attrName)){	
            	 MorphDynaBean  eventbean=(MorphDynaBean)mbean.get(attrName);
          	     Event event=new Event();
          	     event=(Event)getEndBean(event,eventbean,attrName);
          	     ((Root)root).setEvent(event);
          	     
            } else{  
     	          Object attrVal = mbean.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);
        	    }
               } 
            }
            */
     
          }
           rootList.add(root);
         } //dataList.size()
         System.out.println("=-==end======---");
  
	}
	//获取表格 的 元素
	private static List <TableColumns> getTableColumnsBeans(MorphDynaBean mbean,String objectName){
		   TableColumns object=null;
		     List <TableColumns> tableColumnsList=new ArrayList<TableColumns>();
		    // if  ("tableColumns".equals(objectName)){
		       object=new TableColumns(); 

		    try {   
		    //	objectName="com/huigou/uasp/form/pojo/"+Utils.toUpperCaseFirstOne(objectName);
		    	 String classPath=Thread.currentThread().getContextClassLoader().getResource("").getPath();
		    	// objectName=classPath+objectName;
		    //	object=Class.forName(objectName).newInstance();
			} catch (Exception e) {
				e.printStackTrace();
			} 
		   List <MorphDynaBean>tabbeans=(List <MorphDynaBean>) mbean.get(objectName);
		   DynaProperty[] tabdynaProperties=null;
		   Object attrVal=null;
		   String attrName="";
 		   for (MorphDynaBean tabbean:tabbeans){
 			   object=new TableColumns(); 
 			   tabdynaProperties = tabbean.getDynaClass().getDynaProperties();
 		     for(int x=0; x<tabdynaProperties.length;x++){
 			    attrName = tabdynaProperties[x].getName();//属性名称
 			    attrVal = tabbean.get(attrName);//属性值
 			   if(attrVal!=null&&!"null".equals(attrVal.toString().trim())){
 	         	  System.out.println("tableColumns==="+attrName+":="+attrVal);
 	         	  object=(TableColumns)composizeObject(object,tabbean,attrName,attrVal);
 	          	/*if  ("event".equals(attrName)){
 	         	   // List <MorphDynaBean>eventbeans=(List <MorphDynaBean>) tabbean.get(attrName);//属性值
 	          	     MorphDynaBean  eventbean=(MorphDynaBean)tabbean.get(attrName);
 	        	     Event event=new Event();
 	        	     event=(Event)getEndBean(event,eventbean,attrName);
 	        	     ((TableColumns)object).setEvent(event);
 	        	     
 	         	 } else 	if  ("options".equals(attrName)){
 	         		 
 	         		 MorphDynaBean  eventbean=(MorphDynaBean)tabbean.get(attrName);
 	         		 Options options=new Options();
 	         		 options=(Options)getEndBean(options,eventbean,attrName);
 	        	     ((TableColumns)object).setOptions(options);
 	        	     
 	         	  } else  if  ("novalid".equals(attrName)){
 	            	 
 	         	  } else  if  ("rules".equals(attrName)){
 	         		 
 	         	  } else {
 	           	    if (ReflectionUtil.getSetMethod(object.getClass(),attrName)!=null){
 	          	      ReflectionUtil.invokeSet(object, attrName, attrVal);
 	          	    }
 	         	   } */
 	          	
 	           }
 			 
 		     }
 		      tableColumnsList.add(object);
 		   }
 		   return tableColumnsList;
	}
	
	//根据属性 组装对象 
	private static Object composizeObject(Object object,MorphDynaBean bean,String attrName,Object attrVal){
		  // Object attrVal = bean.get(attrName);//属性值
		if  ("event".equals(attrName)){

        	 MorphDynaBean  eventbean=(MorphDynaBean)bean.get(attrName);
      	     Event event=new Event();
      	     event=(Event)getEndBean(event,eventbean,attrName);
      	     ((TableColumns)object).setEvent(event);

       	 } else if  ("options".equals(attrName)){
       		 
       		 MorphDynaBean  eventbean=(MorphDynaBean)bean.get(attrName);
       		 Options options=new Options();
       		 options=(Options)getEndBean(options,eventbean,attrName);
      	     ((TableColumns)object).setOptions(options);
      	     
       	  } else  if  ("novalid".equals(attrName)){
          	 
       	  } else  if  ("rules".equals(attrName)){
       		 
       	  } else {
         	    if (ReflectionUtil.getSetMethod(object.getClass(),attrName)!=null){
        	      ReflectionUtil.invokeSet(object, attrName, attrVal);
        	    }
       	  }
		return object;
	}
	
	
	//获取表单的元素
	private static List <TableColumns> getGridColumnBeans(MorphDynaBean mbean,String objectName){
		   TableColumns object=null;
		     List <TableColumns> tableColumnsList=new ArrayList<TableColumns>();
		    // if  ("tableColumns".equals(objectName)){
		       object=new TableColumns(); 

		   List <MorphDynaBean>tabbeans=(List <MorphDynaBean>) mbean.get(objectName);
		   DynaProperty[] tabdynaProperties=null;
		   DynaProperty[] coldynaProperties=null;
		   Object attrVal=null;
		   String attrName="";
 		   for (MorphDynaBean tabbean:tabbeans){
 			  
 			   tabdynaProperties = tabbean.getDynaClass().getDynaProperties();
 		     for(int x=0; x<tabdynaProperties.length;x++){
 			    attrName = tabdynaProperties[x].getName();//属性名称
 			  // System.out.println("GridColumns9000==="+attrName);
 			  
 			    attrVal = tabbean.get(attrName);//属性值
 			    
 			   if(attrVal!=null&&!"null".equals(attrVal.toString().trim())){
 	         	  System.out.println("GridColumns==="+attrName+":="+attrVal);
 	          	if  ("list".equals(attrName)){
 	          	    
 	            	 List <MorphDynaBean>colbeans=(List <MorphDynaBean>) tabbean.get(attrName);
 	            	 System.out.println("GridColumns===");
 	             for (MorphDynaBean colbean:colbeans){
 	            	 object=new TableColumns(); 
 	            	 coldynaProperties = colbean.getDynaClass().getDynaProperties();
 	      		     for(int y=0; y<coldynaProperties.length;y++){  //
 	      			    attrName = coldynaProperties[y].getName();//属性名称
 	      			    attrVal = colbean.get(attrName);//属性值
 	      			  System.out.println("GridColumns==="+attrName+":----="+attrVal);
 	      			if  ("event".equals(attrName)){
 	      				System.out.println("99999999999");
 	      			//	object=(TableColumns)composizeObject(object,colbean,attrName);
 	      			} else {
 	      			//  object=(TableColumns)composizeObject(object,tabbean,attrName);
 	      			}
 	      		    object=(TableColumns)composizeObject(object,colbean,attrName,attrVal);
 	      		 
 	           /* if  ("event".equals(attrName)){
 	         	   // List <MorphDynaBean>eventbeans=(List <MorphDynaBean>) tabbean.get(attrName);//属性值
 	          	     MorphDynaBean  eventbean=(MorphDynaBean)colbean.get(attrName);
 	        	     Event event=new Event();
 	        	     event=(Event)getEndBean(event,eventbean,attrName);
 	        	     ((TableColumns)object).setEvent(event);
 	        	     
 	         	   } else 	if  ("options".equals(attrName)){
 	         		 
 	         		 MorphDynaBean  eventbean=(MorphDynaBean)colbean.get(attrName);
 	         		 Options options=new Options();
 	         		 options=(Options)getEndBean(options,eventbean,attrName);
 	        	     ((TableColumns)object).setOptions(options);
 	        	     
 	         	    } else  if  ("novalid".equals(attrName)){
 	            	 
 	         	    } else  if  ("rules".equals(attrName)){
 	         		 
 	         	   } else {
 	           	     if (ReflectionUtil.getSetMethod(object.getClass(),attrName)!=null){
 	          	       ReflectionUtil.invokeSet(object, attrName, attrVal);
 	          	     }
 	         	  
 	         	    } 
 	         	   */
 	      		   } //coldynaProperties ended
 	      		  tableColumnsList.add(object);
 	             }//colbeans  ended 
 	           
 	           }
 	          	
 			   }//list ended
 		     }
 		      
 		   }
 		   return tableColumnsList;
	}
	
	private static Object getEndBean(Object object,MorphDynaBean bean,String attrName){
		
  	       Object attrVal=null;
  	        DynaProperty[]  tabdynaProperties = bean.getDynaClass().getDynaProperties();
	       for(int e=0; e<tabdynaProperties.length;e++){
		      attrName = tabdynaProperties[e].getName();//属性名称
		      attrVal = bean.get(attrName);//属性值
		    if(attrVal!=null&&!"null".equals(attrVal.toString().trim())){
		      if (ReflectionUtil.getSetMethod(object.getClass(),attrName)!=null){
		    	  System.out.println("attrName:=="+attrName);
		
		    	  if ("defaultValue".equals(attrName)){ //多个地方同属性 但类型不一致 
		    		  System.out.println("========s");
		
		    	  } else {
        	        ReflectionUtil.invokeSet(object, attrName, attrVal);
		    	  }
        	 }
		    }
	       }
	       return object;
	}
	
	  //**获取属性类型
	 public  static AttributeTypeInter  getAttrNameType(String attrName){
		  AttributeTypeInter inter=null;
	      switch(attrName)
		   { 
		     case "tableColumns":
		       inter=new  GetRootTableColumns();
			   break;
		     case "columns":  
			   inter=new  GetRootFormColumns();
			   break;	
		     case "options":  
				   inter=new  GetRootOptions();
				   break;	
		     case "event":  
				   inter=new  GetRootEvent();
				   break;	
		     case "rules":  
				   inter=new  GetRootRules();
				   break;	
		      default:
		    	  inter=new GetRootDefault();
		    	  break;
		   }
	      return inter;
	  }
	
	 
	
}
