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.config.component.application.report;
 
 import java.util.Map;
 
 
 
 public abstract class AbsConfigBean implements Cloneable
 {
 
     private AbsConfigBean parent;
 
     public AbsConfigBean(AbsConfigBean parent)
     {
         this.=parent;
     }
 
     public void setMExtendConfigForReportType(Map<String,AbsExtendConfigBeanextendConfigForReportType)
     {
         =extendConfigForReportType;
     }
 
     public void setExtendConfigDataForReportType(String key,AbsExtendConfigBean extendConfigDataForReportType)
     {
         .put(key,extendConfigDataForReportType);
     }
 
     {
         return .get(key);
     }
 
     public AbsExtendConfigBean getExtendConfigDataForReportType(Class extendConfigBeanClass)
     {
         if(==null||extendConfigBeanClass==nullreturn null;
         {
             if(extendConfigBeanClass.isInstance(entry.getValue())) return entry.getValue();
         }
         return null;
     }
 
     public AbsConfigBean getParent()
     {
         return ;
     }
 
     public void setParent(AbsConfigBean parent)
     {
         this.=parent;
     }
 
     public ReportBean getReportBean()
     {
         if(this instanceof ReportBean)
         {
             return (ReportBean)this;
         }
         AbsConfigBean bean=this.getParent();
         if(bean==nullreturn null;
         while(!(bean instanceof ReportBean))
         {
             bean=bean.getParent();
             if(bean==nullreturn null;
         }
         return (ReportBean)bean;
     }
 
     {
         return getReportBean().getParentContainer();
     }
 
     public PageBean getPageBean()
    {
        return getParentContainer().getPageBean();
    }
    public AbsConfigBean clone(AbsConfigBean parent)
    {
        try
        {
            AbsConfigBean newbean=(AbsConfigBean)super.clone();
           
            //$ByQXO
            if( != null){
               newbean.setAttrs(new HashMap());
           }
           //ByQXO$
            
            newbean.setParent(parent);
            return newbean;
        }catch(CloneNotSupportedException e)
        {
            throw new WabacusConfigLoadingException("加载报表配置文件失败",e);
        }
    }
    protected void cloneExtendConfig(AbsConfigBean newConfigBean)
    {
        if(!=null)
        {
            Map<String,AbsExtendConfigBeanmTemp=new HashMap<String,AbsExtendConfigBean>();
            newConfigBean.setMExtendConfigForReportType(mTemp);
            for(Entry<String,AbsExtendConfigBeanentryTmp:.entrySet())
            {
                if(entryTmp.getValue()==nullcontinue;
                mTemp.put(entryTmp.getKey(),entryTmp.getValue().clone(newConfigBean));
            }
        }
    }
    
    //$ByQXO 所有属性列表Map,以便扩展类中使用
    private Map<String,Stringattrs;
    public Map<String,StringgetAttrs()
    {
        return  == null ? . : ;
    }
    public void setAttrs(Map<String,Stringattrs)
    {
        this.=attrs;
    }
    
    public void mergeAttrs(Map<String,StringoverrideAttrs){
        if(overrideAttrs == null || overrideAttrs.isEmpty()){
            return;
        }
        if( == null){
             = new HashMap<String,String>();
        }
        .putAll(overrideAttrs);
    }    
    
    //ByQXO$
    
New to GrepCode? Check out our FAQ X