Package org.apache.commons.beanutils

Examples of org.apache.commons.beanutils.LazyDynaBean


    /**
     * Default Constructor which creates a <code>LazyDynaBean</code> to
     * <i>back</i> this form.
     */
    public LazyValidatorForm() {
        super(new LazyDynaBean());
    }
View Full Code Here


     *
     * <p>Override this method if you require a different type of
     * <code>DynaBean</code>.</p>
     */
    protected DynaBean newIndexedBean(String name) {
        return new LazyDynaBean();
    }
View Full Code Here

    public void testCopyProperties() throws Exception
    {
        PropertiesConfiguration src = new PropertiesConfiguration();
        src.setHeader("TestHeader");
        src.setFooter("TestFooter");
        LazyDynaBean dest = new LazyDynaBean();
        BeanHelper.copyProperties(dest, src);
        assertEquals("Wrong footer property", "TestFooter", dest.get("footer"));
        assertEquals("Wrong header property", "TestHeader", dest.get("header"));
    }
View Full Code Here

        Collection<Object> beans = new ArrayList<Object>();
        beans.add(params);
        beans.add(wrapBean);
        if (withDynaBean)
        {
            wrapDynaBean = new LazyDynaBean();
            wrapDynaBean.set(MAPPED_PROPERTY, "someKey", "somValue");
            beans.add(wrapDynaBean);
        }
        return new MultiWrapDynaBean(beans);
    }
View Full Code Here

    kbase.addKnowledgePackages( kpkgs );
   
   
    StatefulKnowledgeSession ksession = kbase.newStatefulKnowledgeSession();
   
    LazyDynaBean bean = new LazyDynaBean();
   
    FactHandle stiltonHandle = ksession.insert( bean )
   
   
  }
View Full Code Here

     * 插入insert
     * 删除retract
     *
     */
   
    LazyDynaBean bean = new LazyDynaBean();
    bean.set("radius", 10);
    ksession.setGlobal("bean", bean);
    ksession.insert(bean);
   
//    ksession.fireAllRules( new RuleNameEndsWithAgendaFilter( "Test" ) );
    ksession.fireAllRules( new RuleNameStartsWithAgendaFilter( "第一" ) );
//    ksession.fireAllRules();
   
    System.out.println(bean.get("radius"));
//    FactHandle stiltonHandle = ksession.insert( bean ); 
   
   
  }
View Full Code Here

    }else{
      dep_id = GetObjectString.getMDB2RDBID(dep_id);
      List<MeasureTable> mtRecords = HibernateGeneralQuery.query(measureTableDAO.getHibernateTemplate(), measureTableQuery, dep_id,time_id);
      List<LazyDynaBean> beans = new ArrayList<LazyDynaBean>();
      for(MeasureTable mt:mtRecords){
        LazyDynaBean bean = new LazyDynaBean();
        bean.set("em_id", mt.getId().getEMId());
        EnergyMedia energyMedia = energyMediaDAO.findById(mt.getId().getEMId());
        if(energyMedia!=null){
          bean.set("em_name", energyMedia.getName());
          bean.set("em_unit", energyMedia.getUnit());
          bean.set("em_scc", energyMedia.getScc());
        }
        bean.set("department_id", mt.getId().getHierarchyId());
        bean.set("time_id", mt.getId().getTimeId());
        bean.set("MValue", mt.getMValue());
        bean.set("SValue", mt.getSValue());
        bean.set("value", mt.getValue());
        bean.set("CValue", mt.getCValue());
        if(mt.getValue()!=null){
          bean.set("scc", mt.getCValue()/mt.getValue());
        }
        beans.add(bean);
      }
      result.setSucceed();
      result.setData(beans);
View Full Code Here

    Long total = HibernateGeneralQuery.queryCount(hibernateTemplate, query2, departmentIDs);

    ArrayList<LazyDynaBean> beans = new ArrayList<LazyDynaBean>();
    for(Equipment equipment:Tequipments)
    {
      LazyDynaBean bean = new LazyDynaBean();
//      将所需类型的属性放入bean中,Date类型需特殊处理
      ObjectListConvert2DynaBeanList.convert(bean,equipment);
      Date puchaseDate = equipment.getPurchaseTime();
      SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
      String date = (puchaseDate!=null)?sdf.format(puchaseDate):"";
      bean.set("purchaseDate",date);
      bean.set("department_id", equipment.getEntHierarchy().getId());
      bean.set("department_name", equipment.getEntHierarchy().getName());
      beans.add(bean);
    }
//    结果格式为{"total":100,"records":[...]};   
    LazyDynaBean resultBean = new LazyDynaBean();
    resultBean.set("total",total);
    resultBean.set("records",beans);
    result.setData(resultBean);
    result.setSucceed();
    return result;
  }
View Full Code Here

    List<MaintainRecord> maintainRecords = new ArrayList<MaintainRecord>();
    maintainRecords.addAll(mrs);
    ArrayList<LazyDynaBean> beans = new ArrayList<LazyDynaBean>();
    for(MaintainRecord maintainRecord:maintainRecords)
    {
      LazyDynaBean bean = new LazyDynaBean();
      ObjectListConvert2DynaBeanList.convert(bean, maintainRecord);
      Date sendTime = maintainRecord.getSendTime();
      Date backTime = maintainRecord.getBackTime();
      SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
      String sendTimeStr = (sendTime!=null)?sdf.format(sendTime):"";
      String backTimeStr = (backTime!=null)?sdf.format(backTime):"";
      bean.set("sendTimeStr",sendTimeStr);
      bean.set("backTimeStr",backTimeStr);
      beans.add(bean);
    }
    result.setSucceed();
    //要将查询到的数据转为dynaBean的List,并且将原对象中非简单类型排除(needPropertyTypes)
    result.setData(beans);
View Full Code Here

    List<DepreciationCaculator> caculators = new ArrayList<DepreciationCaculator>();
    caculators.addAll(Tcaculators);
    ArrayList<LazyDynaBean>beans = new ArrayList<LazyDynaBean>();
    for(DepreciationCaculator calculator:caculators)
    {
      LazyDynaBean bean = new LazyDynaBean();
      ObjectListConvert2DynaBeanList.convert(bean,calculator);
      bean.set("methodName",calculator.getDepAlgorithm().getName());
      bean.set("algoritm_ID",calculator.getDepAlgorithm().getId());
      beans.add(bean);
    }   
    result.setData(beans);
    result.setSucceed();
    return result;
View Full Code Here

TOP

Related Classes of org.apache.commons.beanutils.LazyDynaBean

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.