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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? hierarchicalconfigurationconverter.java

?? java servlet著名論壇源代碼
?? JAVA
字號:
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.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;

/**
 * <p>A base class for converters that transform a normal configuration
 * object into a hierarchical configuration.</p>
 * <p>This class provides a default mechanism for iterating over the keys in a
 * configuration and to throw corresponding element start and end events. By
 * handling these events a hierarchy can be constructed that is equivalent to
 * the keys in the original configuration.</p>
 * <p>Concrete sub classes will implement event handlers that generate SAX
 * events for XML processing or construct a
 * <code>HierarchicalConfiguration</code> root node. All in all with this class
 * it is possible to treat a default configuration as if it was a hierarchical
 * configuration, which can be sometimes useful.</p>
 * @see HierarchicalConfiguration
 *
 * @author <a href="mailto:oliver.heger@t-online.de">Oliver Heger</a>
 * @version $Id: HierarchicalConfigurationConverter.java,v 1.1 2003/12/09 08:25:30 huumai Exp $
 */
abstract class HierarchicalConfigurationConverter
{
    /**
     * Processes the specified configuration object. This method implements
     * the iteration over the configuration's keys. All defined keys are
     * translated into a set of element start and end events represented by
     * calls to the <code>elementStart()</code> and
     * <code>elementEnd()</code> methods.
     * @param config the configuration to be processed
     */
    public void process(Configuration config)
    {
        if (config != null)
        {
            ConfigurationKey keyEmpty = new ConfigurationKey();
            ConfigurationKey keyLast = keyEmpty;

            for (Iterator it = config.getKeys(); it.hasNext();)
            {
                String key = (String) it.next();
                ConfigurationKey keyAct = new ConfigurationKey(key);
                closeElements(keyLast, keyAct);
                String elem = openElements(keyLast, keyAct);
                fireValue(elem, config.getProperty(key));
                keyLast = keyAct;
            } /* for */

            closeElements(keyLast, keyEmpty); // close all open
        }
    }

    /**
     * An event handler method that is called when an element starts.
     * Concrete sub classes must implement it to perform a proper event
     * handling.
     * @param name the name of the new element
     * @param value the element's value; can be <b>null</b> if the element
     * does not have any value
     */
    protected abstract void elementStart(String name, Object value);

    /**
     * An event handler method that is called when an element ends. For each
     * call of <code>elementStart()</code> there will be a corresponding call
     * of this method. Concrete sub classes must implement it to perform a
     * proper event handling.
     * @param name the name of the ending element
     */
    protected abstract void elementEnd(String name);

    /**
     * Fires all necessary element end events for the specified keys. This
     * method is called for each key obtained from the configuration to be
     * converted. It calculates the common part of the actual and the last
     * processed key and thus determines how many elements must be
     * closed.
     * @param keyLast the last processed key
     * @param keyAct the actual key
     */
    protected void closeElements(
        ConfigurationKey keyLast,
        ConfigurationKey keyAct)
    {
        ConfigurationKey keyDiff = keyAct.differenceKey(keyLast);
        Iterator it = reverseIterator(keyDiff);
        if (it.hasNext())
        {
            // Skip first because it has already been closed by fireValue()
            it.next();
        } /* if */

        while (it.hasNext())
        {
            elementEnd((String) it.next());
        } /* while */
    }

    /**
     * Helper method for determining a reverse iterator for the specified key.
     * This implementation returns an iterator that returns the parts of the
     * given key in reverse order, ignoring indices.
     * @param key the key
     * @return a reverse iterator for the parts of this key
     */
    protected Iterator reverseIterator(ConfigurationKey key)
    {
        List list = new ArrayList();
        for (ConfigurationKey.KeyIterator it = key.iterator(); it.hasNext();)
        {
            list.add(it.nextKey());
        } /* for */

        Collections.reverse(list);
        return list.iterator();
    }

    /**
     * Fires all necessary element start events for the specified key. This
     * method is called for each key obtained from the configuration to be
     * converted. It ensures that all elements "between" the last key and the
     * actual key are opened.
     * @param keyLast the last processed key
     * @param keyAct the actual key
     * @return the name of the last element on the path
     */
    protected String openElements(
        ConfigurationKey keyLast,
        ConfigurationKey keyAct)
    {
        ConfigurationKey.KeyIterator it =
            keyLast.differenceKey(keyAct).iterator();

        for (it.nextKey(); it.hasNext(); it.nextKey())
        {
            elementStart(it.currentKey(), null);
        } /* for */

        return it.currentKey();
    }

    /**
     * Fires all necessary element start events with the actual element values.
     * This method is called for each key obtained from the configuration to be
     * processed with the last part of the key as argument. The value can be
     * either a single value or a collection.
     * @param name the name of the actual element
     * @param value the element's value
     */
    protected void fireValue(String name, Object value)
    {
        if (value != null && value instanceof Collection)
        {
            for (Iterator it = ((Collection) value).iterator(); it.hasNext();)
            {
                fireValue(name, it.next());
            } /* for */
        } /* if */

        else
        {
            elementStart(name, value);
            elementEnd(name);
        } /* else */
    }
}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品水嫩水嫩| 日本道在线观看一区二区| 欧美电视剧在线观看完整版| 婷婷丁香激情综合| 日韩精品一区二区三区在线观看| 国产精品系列在线| 久久先锋资源网| 午夜精品久久久久久久| 国产精品久久久久影院| 亚洲高清在线视频| 欧美成人r级一区二区三区| 日本高清不卡视频| 成人av免费观看| 国产专区欧美精品| 日本成人在线看| 亚洲综合区在线| 中文字幕中文字幕中文字幕亚洲无线| 欧美一卡2卡3卡4卡| 欧美性猛片xxxx免费看久爱| 不卡在线观看av| 国产成人免费在线视频| 韩国av一区二区三区四区| 91免费小视频| 国产精品一区2区| 久久国产麻豆精品| 日韩中文字幕麻豆| 午夜精品久久久久久久久久| 亚洲一级在线观看| 亚洲你懂的在线视频| 国产精品久久久久久久久免费相片 | 国产大片一区二区| 久久成人羞羞网站| 蜜桃91丨九色丨蝌蚪91桃色| 丝袜美腿高跟呻吟高潮一区| 亚洲国产精品一区二区www| 一区二区在线观看免费| 亚洲品质自拍视频| 亚洲卡通欧美制服中文| 亚洲人成精品久久久久| 亚洲欧美一区二区三区极速播放 | 精品国产第一区二区三区观看体验| 欧美日韩国产高清一区二区| 欧美日韩一级二级| 欧美日产国产精品| 欧美一区二区观看视频| 日韩欧美综合在线| 久久精品国产久精国产爱| 欧美aaa在线| 久久国产精品无码网站| 国产呦萝稀缺另类资源| 国产精品一区二区在线看| 国产剧情一区二区| 成人性色生活片| 99r国产精品| 色婷婷国产精品| 欧美日韩精品综合在线| 日韩欧美精品三级| 国产日韩欧美a| 亚洲免费大片在线观看| 亚洲第一激情av| 国内精品久久久久影院色| 国产91丝袜在线播放| 91视频你懂的| 欧美精品乱码久久久久久按摩 | 欧美视频中文字幕| 欧美一级黄色大片| 国产精品久久久久影院老司| 亚洲午夜激情av| 久久精品国产色蜜蜜麻豆| 成人免费视频免费观看| 欧美亚洲动漫制服丝袜| 日韩午夜电影av| 国产精品乱码人人做人人爱| 亚洲国产视频一区二区| 久久se精品一区二区| av电影天堂一区二区在线 | 国产精品进线69影院| 一区二区三区影院| 六月丁香综合在线视频| 成人av资源下载| 欧美一级视频精品观看| 国产精品麻豆网站| 日本美女视频一区二区| 成人做爰69片免费看网站| 欧美亚一区二区| 久久网这里都是精品| 亚洲美女电影在线| 国产剧情在线观看一区二区| 欧洲av在线精品| 久久精品人人做人人综合| 亚洲一区二区成人在线观看| 国产91丝袜在线观看| 日韩亚洲欧美成人一区| ㊣最新国产の精品bt伙计久久| 日韩激情在线观看| 91欧美激情一区二区三区成人| 欧美精品一区二| 亚洲电影在线播放| 成人av电影在线| 精品国产1区2区3区| 亚洲高清视频的网址| 成人动漫一区二区在线| 精品久久久久久久久久久久久久久 | 在线看国产日韩| 国产午夜精品美女毛片视频| 午夜精品在线视频一区| 92国产精品观看| 亚洲精品一区二区三区蜜桃下载| 亚洲成人黄色小说| 91啦中文在线观看| 中文字幕免费一区| 久久www免费人成看片高清| 欧美三电影在线| 亚洲免费毛片网站| av电影在线观看一区| 国产欧美精品一区二区色综合 | 午夜在线成人av| 91蜜桃在线免费视频| 欧美国产欧美综合| 国产在线精品一区在线观看麻豆| 91麻豆精品国产91久久久久久 | 亚洲午夜在线观看视频在线| 成人av网址在线观看| 久久精品人人做人人综合 | 91免费版pro下载短视频| 国产色综合久久| 精品伊人久久久久7777人| 91精品国产综合久久蜜臀| 亚洲国产成人av好男人在线观看| 91日韩精品一区| 一区二区三区在线观看欧美| 91国偷自产一区二区三区成为亚洲经典 | 日本精品免费观看高清观看| 中文字幕在线不卡一区| 国产成人h网站| 中文字幕av一区二区三区免费看| 国产激情一区二区三区四区| 久久久综合视频| 国产精品一二三区| 欧美极品aⅴ影院| www.色综合.com| 亚洲蜜臀av乱码久久精品 | 日韩视频永久免费| 青青草成人在线观看| 日韩精品中文字幕在线不卡尤物| 六月婷婷色综合| 久久久久久**毛片大全| 成人性生交大合| 亚洲激情在线激情| 欧美日韩视频在线观看一区二区三区 | 日韩欧美精品在线| 国产乱人伦偷精品视频免下载| 久久婷婷国产综合精品青草| 国产成a人亚洲| 亚洲三级在线播放| 欧美日韩大陆一区二区| 另类小说欧美激情| 国产片一区二区| 色视频欧美一区二区三区| 亚州成人在线电影| 久久综合色婷婷| av日韩在线网站| 香蕉成人伊视频在线观看| 26uuu精品一区二区三区四区在线 26uuu精品一区二区在线观看 | 视频在线观看91| 精品久久久久久综合日本欧美| 懂色一区二区三区免费观看| 亚洲欧美一区二区三区国产精品 | 国内外成人在线| 欧美国产一区视频在线观看| 在线观看不卡一区| 老鸭窝一区二区久久精品| 国产精品欧美极品| 欧美性大战久久久久久久蜜臀| 国内精品国产三级国产a久久| 亚洲欧洲制服丝袜| 欧美大尺度电影在线| 97se亚洲国产综合自在线| 日本三级韩国三级欧美三级| 中文字幕av一区二区三区免费看 | 4438亚洲最大| 成人国产亚洲欧美成人综合网 | 韩国v欧美v亚洲v日本v| 亚洲精选视频在线| 精品sm捆绑视频| 欧美影院一区二区三区| 国产精品资源网站| 亚洲高清不卡在线观看| 欧美国产一区二区在线观看 | 91精品免费在线| 成a人片亚洲日本久久| 免费观看日韩电影| 亚洲精品乱码久久久久久久久| 精品国产91久久久久久久妲己| 在线精品观看国产| 国产精品香蕉一区二区三区| 午夜精品久久久久久久 | 亚洲日本成人在线观看| 精品国免费一区二区三区| 91国偷自产一区二区三区成为亚洲经典 |