Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /* 
   * Copyright (C) 2010---2013 星星(wuweixing)<349446658@qq.com>
   * 
   * This file is part of Wabacus 
   * 
   * Wabacus is free software: you can redistribute it and/or modify
   * it under the terms of the GNU Lesser General Public License as published by
   * the Free Software Foundation, either version 3 of the License, or
   * (at your option) any later version.
  *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public License
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 package com.wabacus.system.inputbox.option;
 
 
 public abstract class AbsOptionBean implements Cloneable
 {
 
     protected AbsInputBox ownerInputboxObj;
     
     public AbsOptionBean(AbsInputBox ownerInputboxObj)
     {
         this.=ownerInputboxObj;
     }
     
     public AbsInputBox getOwnerInputboxObj()
     {
         return ;
     }
 
     {
         return ;
     }
 
     public void setOptionDatasourceObj(AbsOptionDatasource optionDatasourceObj)
     {
         this.=optionDatasourceObj;
     }
     
     public void loadOptionDynDatasourceObj(XmlElementBean eleOptionBean,String source)
     {
         ReportBean rbean=this..getOwner().getReportBean();
         AbsOptionDatasource optionDatasourceObjTmp=null;
         if(Tools.isDefineKey("@",source))
         {
             SQLOptionDatasource sqldatasource=new SQLOptionDatasource();
             String datasource=eleOptionBean.attributeValue("datasource");
             if(datasource!=nullsqldatasource.setDatasource(datasource.trim());
             sqldatasource.setSql(Tools.getRealKeyByDefine("@",source));
             sqldatasource.setLstConditions(ComponentConfigLoadManager.loadConditionsInOtherPlace(eleOptionBean,rbean));
             optionDatasourceObjTmp=sqldatasource;
         }else if(Tools.isDefineKey("class",source))
         {
             String classname=Tools.getRealKeyByDefine("class",source);
             if(classname.trim().equals(""))
             {
                 throw new WabacusConfigLoadingException("报表"+rbean.getPath()+"配置的选项的source"+"指定的JAVA类为空");
             }
             Object optionDsObj=null;
             try
             {
                 optionDsObj=..loadClassByCurrentLoader(classname).newInstance();
             }catch(Exception e)
             {
                 throw new WabacusConfigLoadingException("报表"+rbean.getPath()+"配置的选项的source"+"指定的JAVA类"+classname+"无法实例化",e);
             }
             if(!(optionDsObj instanceof AbsOptionDatasource))
             {
                 throw new WabacusConfigLoadingException("报表"+rbean.getPath()+"配置的选项的source"+"指定的JAVA类没有继承"+AbsOptionDatasource.class.getName()+"类");
             }
             optionDatasourceObjTmp=((AbsOptionDatasource)optionDsObj);
         }
         if(optionDatasourceObjTmp!=nulloptionDatasourceObjTmp.setOwnerOptionBean(this);
         this.setOptionDatasourceObj(optionDatasourceObjTmp);
     }
     
     public void doPostLoad()
     {
         if(this.!=nullthis..doPostLoad();
     }
     
     public AbsOptionBean clone(AbsInputBox newOwnerInputboxObj
     {
         AbsOptionBean newOptionBean=null;
        try
        {
            newOptionBean=(AbsOptionBean)super.clone();
            newOptionBean.ownerInputboxObj=newOwnerInputboxObj;
            if(!=null)
            {
                newOptionBean.optionDatasourceObj=this..clone(newOptionBean);
            }
        }catch(CloneNotSupportedException e)
        {
            e.printStackTrace();
        }
        return newOptionBean;
    }
    
    
New to GrepCode? Check out our FAQ X