亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? configurationfactory.java

?? java servlet著名論壇源代碼
?? JAVA
?? 第 1 頁 / 共 2 頁
字號:
package net.myvietnam.mvncore.configuration;
/* ====================================================================
 * The Apache Software License, Version 1.1
 *
 * Copyright (c) 1999-2003 The Apache Software Foundation.  All rights
 * reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 *
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 *
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in
 *    the documentation and/or other materials provided with the
 *    distribution.
 *
 * 3. The end-user documentation included with the redistribution, if
 *    any, must include the following acknowledgement:
 *       "This product includes software developed by the
 *        Apache Software Foundation (http://www.apache.org/)."
 *    Alternately, this acknowledgement may appear in the software itself,
 *    if and wherever such third-party acknowledgements normally appear.
 *
 * 4. The names "The Jakarta Project", "Commons", and "Apache Software
 *    Foundation" must not be used to endorse or promote products derived
 *    from this software without prior written permission. For written
 *    permission, please contact apache@apache.org.
 *
 * 5. Products derived from this software may not be called "Apache"
 *    nor may "Apache" appear in their names without prior written
 *    permission of the Apache Software Foundation.
 *
 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
 * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 * SUCH DAMAGE.
 * ====================================================================
 *
 * This software consists of voluntary contributions made by many
 * individuals on behalf of the Apache Software Foundation.  For more
 * information on the Apache Software Foundation, please see
 * <http://www.apache.org/>.
 */
import java.io.File;
import java.io.InputStream;
import java.net.URL;
import java.util.Collection;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.Stack;

import org.apache.commons.digester.AbstractObjectCreationFactory;
import org.apache.commons.digester.Digester;
import org.apache.commons.digester.ObjectCreationFactory;
import org.apache.commons.digester.xmlrules.DigesterLoader;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.xml.sax.Attributes;
import org.xml.sax.SAXException;
/**
 * Factory class to create a CompositeConfiguration from a .xml file using
 * Digester.  By default it can handle the Configurations from commons-
 * configuration.  If you need to add your own, then you can pass in your own
 * digester rules to use.  It is also namespace aware, by providing a
 * digesterRuleNamespaceURI.
 *
 * @author <a href="mailto:epugh@upstate.com">Eric Pugh</a>
 * @author <a href="mailto:hps@intermeta.de">Henning P. Schmiedehausen</a>
 * @author <a href="mailto:oliver.heger@t-online.de">Oliver Heger</a>
 * @version $Id: ConfigurationFactory.java,v 1.1 2003/12/09 08:25:30 huumai Exp $
 */
public class ConfigurationFactory implements BasePathLoader
{
    /** Constant for the root element in the info file.*/
    private static final String SEC_ROOT = "configuration/";

    /** Constant for the override section.*/
    private static final String SEC_OVERRIDE = SEC_ROOT + "override/";

    /** Constant for the additional section.*/
    private static final String SEC_ADDITIONAL = SEC_ROOT + "additional/";

    /** Constant for the name of the load method.*/
    private static final String METH_LOAD = "load";

    /** Constant for the default base path (points to actual directory).*/
    private static final String DEF_BASE_PATH = ".";

    /** The XML file with the details about the configuration to load */
    private String configurationFileName;
    /** The URL to the XML file with the details about the configuration to
     * load.
     */
    private URL configurationURL;
    /**
     * The implicit base path for included files. This path is determined by
     * the configuration to load and used unless no other base path was
     * explicitely specified.
     */
    private String impliciteBasePath;
    /** The basePath to prefix file paths for file based property files. */
    private String basePath;
    /** static logger */
    private static Log log = LogFactory.getLog(ConfigurationFactory.class);
    /** URL for xml digester rules file */
    private URL digesterRules;
    /** The digester namespace to parse */
    private String digesterRuleNamespaceURI;
    /**
     * C'tor
     */
    public ConfigurationFactory()
    {
        setBasePath(DEF_BASE_PATH);
    }
    /**
     * C'tor with ConfigurationFile Name passed
     *
     * @param configurationFileName The path to the configuration file
     */
    public ConfigurationFactory(String configurationFileName)
    {
        this.configurationFileName = configurationFileName;
    }
    /**
     * Return the configuration provided by this factory. It
     * loads the configuration file which is a XML description of
     * the actual configurations to load. It can contain various
     * different types of configuration, currently Properties, XML and JNDI.
     *
     * @return A Configuration object
     * @throws Exception A generic exception that we had trouble during the
     * loading of the configuration data.
     */
    public Configuration getConfiguration() throws Exception
    {
        Digester digester;
        ConfigurationBuilder builder = new ConfigurationBuilder();
        URL url = getConfigurationURL();
        if(url == null)
        {
            url = ConfigurationUtils.getURL(impliciteBasePath,
            getConfigurationFileName());
        }  /* if */
        InputStream input = url.openStream();

        if (getDigesterRules() == null)
        {
            digester = new Digester();
            configureNamespace(digester);
            initDefaultDigesterRules(digester);
        }
        else
        {
            digester = DigesterLoader.createDigester(getDigesterRules());
            // This might already be too late. As far as I can see, the namespace
            // awareness must be configured before the digester rules are loaded.
            configureNamespace(digester);
        }
        // Put the composite builder object below all of the other objects.
        digester.push(builder);
        // Parse the input stream to configure our mappings
        try
        {
            digester.parse(input);
            input.close();
        }
        catch (SAXException e)
        {
            log.error("SAX Exception caught", e);
            throw e;
        }
        return builder.getConfiguration();
    }
    /**
     * Returns the configurationFile.
     *
     * @return The name of the configuration file. Can be null.
     */
    public String getConfigurationFileName()
    {
        return configurationFileName;
    }
    /**
     * Sets the configurationFile.
     * @param configurationFileName  The name of the configurationFile to use.
     */
    public void setConfigurationFileName(String configurationFileName)
    {
        File file = new File(configurationFileName).getAbsoluteFile();
        this.configurationFileName = file.getName();
        impliciteBasePath = file.getParent();
    }

    /**
     * Returns the URL of the configuration file to be loaded.
     * @return the URL of the configuration to load
     */
    public URL getConfigurationURL()
    {
        return configurationURL;
    }

    /**
     * Sets the URL of the configuration to load. This configuration can be
     * either specified by a file name or by a URL.
     * @param url the URL of the configuration to load
     */
    public void setConfigurationURL(URL url)
    {
        configurationURL = url;
        impliciteBasePath = url.toString();

        // The following is a hack caused by the need to keep backwards
        // compatibility: Per default the base path is set to the current
        // directory. For loading from a URL this makes no sense. So
        // unless no specific base path was set we clear it.
        if(DEF_BASE_PATH.equals(getBasePath()))
        {
            setBasePath(null);
        }  /* if */
    }

    /**
     * Returns the digesterRules.
     * @return URL
     */
    public URL getDigesterRules()
    {
        return digesterRules;
    }
    /**
     * Sets the digesterRules.
     * @param digesterRules The digesterRules to set
     */
    public void setDigesterRules(URL digesterRules)
    {
        this.digesterRules = digesterRules;
    }
    /**
     * Initializes the parsing rules for the default digester
     *
     * This allows the Configuration Factory to understand the
     * default types: Properties, XML and JNDI. Two special sections are
     * introduced: <code>&lt;override&gt;</code> and
     * <code>&lt;additional&gt;</code>.
     *
     * @param digester The digester to configure
     */
    protected void initDefaultDigesterRules(Digester digester)
    {
        initDigesterSectionRules(digester, SEC_ROOT, false);
        initDigesterSectionRules(digester, SEC_OVERRIDE, false);
        initDigesterSectionRules(digester, SEC_ADDITIONAL, true);
    }

    /**
     * Sets up digester rules for a specified section of the configuration
     * info file.
     * @param digester the current digester instance
     * @param matchString specifies the section
     * @param additional a flag if rules for the additional section are to be
     * added
     */
    protected void initDigesterSectionRules(Digester digester,
    String matchString, boolean additional)
    {
        setupDigesterInstance(
            digester,
            matchString + "properties",
            new BasePathConfigurationFactory(PropertiesConfiguration.class),
            METH_LOAD,
            additional);
        setupDigesterInstance(
            digester,
            matchString + "dom4j",
            new BasePathConfigurationFactory(DOM4JConfiguration.class),
            METH_LOAD,
            additional);
        setupDigesterInstance(
            digester,
            matchString + "hierarchicalDom4j",
            new BasePathConfigurationFactory(HierarchicalDOM4JConfiguration.class),
            METH_LOAD,
            additional);
        setupDigesterInstance(
            digester,
            matchString + "jndi",
            new JNDIConfigurationFactory(),
            null,
            additional);
    }

    /**
     * Sets up digester rules for a configuration to be loaded.
     * @param digester the current digester
     * @param matchString the pattern to match with this rule
     * @param factory an ObjectCreationFactory instance to use for creating new
     * objects
     * @param method the name of a method to be called or <b>null</b> for none
     * @param additional a flag if rules for the additional section are to be
     * added
     */
    protected void setupDigesterInstance(
        Digester digester,
        String matchString,
        ObjectCreationFactory factory,
        String method,
        boolean additional)
    {
        if(additional)
        {
            setupUnionRules(digester, matchString);
        }  /* if */
        digester.addFactoryCreate(matchString, factory);
        digester.addSetProperties(matchString);
        if(method != null)
        {
            digester.addCallMethod(matchString, method);
        }  /* if */
        digester.addSetNext(
            matchString,
            "addConfiguration",
            Configuration.class.getName());
    }

    /**
     * Sets up rules for configurations in the additional section.
     * @param digester the current digester
     * @param matchString the pattern to match with this rule
     */
    protected void setupUnionRules(Digester digester, String matchString)
    {
        digester.addObjectCreate(matchString,
        AdditionalConfigurationData.class);
        digester.addSetProperties(matchString);
        digester.addSetNext(matchString, "addAdditionalConfig",
        AdditionalConfigurationData.class.getName());
    }
    /**
     * Returns the digesterRuleNamespaceURI.
     *
     * @return A String with the digesterRuleNamespaceURI.
     */
    public String getDigesterRuleNamespaceURI()
    {
        return digesterRuleNamespaceURI;
    }
    /**
     * Sets the digesterRuleNamespaceURI.
     *
     * @param digesterRuleNamespaceURI The new digesterRuleNamespaceURI to use
     */
    public void setDigesterRuleNamespaceURI(String digesterRuleNamespaceURI)
    {

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
97se亚洲国产综合自在线观| 日韩精品视频网站| 国产亚洲一区二区三区在线观看| 欧美日韩精品系列| 91精品黄色片免费大全| 在线综合视频播放| 久久99精品国产麻豆婷婷| 美美哒免费高清在线观看视频一区二区| 青草国产精品久久久久久| 激情六月婷婷久久| 丁香婷婷综合五月| 欧美亚洲愉拍一区二区| 大白屁股一区二区视频| 欧美吞精做爰啪啪高潮| 日韩欧美区一区二| 亚洲欧洲av在线| 免费三级欧美电影| 日本伊人午夜精品| 成人免费va视频| 欧美日韩国产高清一区二区| 久久先锋影音av| 亚洲三级理论片| 国产精品入口麻豆九色| 亚洲一区中文在线| 久久99精品一区二区三区| 偷窥国产亚洲免费视频| 国产成人精品亚洲午夜麻豆| 欧美影院午夜播放| 国产亚洲视频系列| 日韩av网站免费在线| 国产激情偷乱视频一区二区三区| 色婷婷精品久久二区二区蜜臀av| 91精品国产麻豆| 欧美激情综合五月色丁香| 午夜激情一区二区| 成人av集中营| 欧美一级日韩一级| 欧美精品 国产精品| 久久久久88色偷偷免费| 香蕉久久一区二区不卡无毒影院| 国产成人av电影在线| caoporn国产精品| 欧美变态凌虐bdsm| 一区二区三区四区国产精品| 国产黄色精品视频| 日韩视频在线一区二区| 亚洲午夜久久久| 青青草国产成人av片免费| 国产剧情一区二区三区| 欧美又粗又大又爽| 国产福利一区二区三区视频在线 | 7777精品久久久大香线蕉| 日韩一区二区三区视频| 日韩精品中文字幕在线一区| 91精品国产色综合久久ai换脸| 日本中文一区二区三区| 欧美日韩一区二区三区在线看| 亚洲日本电影在线| 欧美三级韩国三级日本三斤| 免费成人性网站| 久久久久久久精| 色综合久久99| 免费看精品久久片| 国产精品美女一区二区三区| 欧美丝袜自拍制服另类| 久久 天天综合| 亚洲精品国产a久久久久久| 欧美久久婷婷综合色| 国产成人av网站| 亚洲电影一级黄| 久久久91精品国产一区二区精品 | 国产精品亚洲综合一区在线观看| 中文字幕免费在线观看视频一区| 色视频欧美一区二区三区| 免费观看91视频大全| 亚洲色图自拍偷拍美腿丝袜制服诱惑麻豆| 欧美日韩一区二区在线观看| 成人永久免费视频| 免费久久99精品国产| 亚洲私人黄色宅男| 精品久久久久99| 欧美日韩中文另类| 国产成人99久久亚洲综合精品| 婷婷国产v国产偷v亚洲高清| 国产精品久久久久久亚洲毛片| 欧美一区二区三区免费观看视频| youjizz久久| 久久国产精品区| 亚洲综合在线观看视频| 欧美激情在线一区二区| 精品免费国产一区二区三区四区| 91黄色在线观看| 高清av一区二区| 激情综合色综合久久综合| 香蕉成人啪国产精品视频综合网 | 精品电影一区二区三区| 欧美怡红院视频| 99久久精品99国产精品| 国产精品一级在线| 久久电影国产免费久久电影| 亚洲第一主播视频| 亚洲一区二区三区影院| 亚洲精品成人a在线观看| 国产精品传媒视频| 欧美国产成人在线| 久久精品人人做人人综合| 日韩三级伦理片妻子的秘密按摩| 欧美日韩你懂的| 在线观看成人免费视频| 97久久久精品综合88久久| 成人综合婷婷国产精品久久免费| 国产一区二区精品久久91| 乱中年女人伦av一区二区| 轻轻草成人在线| 久久精品国产精品亚洲综合| 免费在线一区观看| 男女激情视频一区| 狠狠网亚洲精品| 国产一区免费电影| 国产乱子伦视频一区二区三区| 国产一区二区三区精品欧美日韩一区二区三区 | 亚洲在线一区二区三区| 欧美午夜在线一二页| 99精品欧美一区| 97久久久精品综合88久久| 91亚洲国产成人精品一区二区三 | 欧美国产日韩a欧美在线观看| 日韩免费高清av| 欧美成人精品3d动漫h| 精品99一区二区| 国产喷白浆一区二区三区| 亚洲国产电影在线观看| 亚洲欧美日韩精品久久久久| 亚洲美女淫视频| 午夜电影一区二区| 久久99精品国产麻豆不卡| 成人午夜在线免费| 在线免费观看日本欧美| 91麻豆精品91久久久久久清纯| 日韩女优av电影在线观看| 国产拍欧美日韩视频二区| 亚洲精品久久嫩草网站秘色| 三级在线观看一区二区| 精品一区二区三区蜜桃| 成人av资源下载| 欧美日韩精品一区二区天天拍小说 | 日日夜夜精品视频天天综合网| 美女网站一区二区| 国产成人av一区二区| 欧美亚洲国产bt| 久久蜜桃香蕉精品一区二区三区| 亚洲精品欧美二区三区中文字幕| 日韩电影免费在线观看网站| 国产成人在线视频免费播放| 在线观看av不卡| 久久奇米777| 亚洲尤物视频在线| 成人一级片在线观看| 欧美高清www午色夜在线视频| 久久影院视频免费| 亚洲在线免费播放| 国产毛片精品国产一区二区三区| 91麻豆免费在线观看| 欧美一级二级三级乱码| 亚洲免费观看视频| 国产精品一二三区在线| 777色狠狠一区二区三区| 国产精品国产三级国产aⅴ中文| 天堂一区二区在线免费观看| 99视频在线精品| 久久久久久久久一| 日韩在线观看一区二区| 色哦色哦哦色天天综合| 亚洲国产精品av| 久久99精品国产| 欧美日本在线视频| 亚洲美女视频在线观看| 国产精品99久久久| 日韩女优av电影在线观看| 午夜电影一区二区三区| 99国产一区二区三精品乱码| 久久一留热品黄| 美腿丝袜一区二区三区| 欧美剧情片在线观看| 亚洲综合区在线| 91色porny| 国产精品无圣光一区二区| 国内一区二区在线| 欧美变态tickle挠乳网站| 五月天中文字幕一区二区| 91福利国产精品| 狠狠色丁香婷综合久久| 3d动漫精品啪啪一区二区竹菊| 亚洲精品videosex极品| 99re免费视频精品全部| 亚洲欧洲日韩av| 成人免费看片app下载| 国产精品丝袜91| 成人污污视频在线观看| 国产欧美一区二区精品性色超碰|