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

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

?? propertymessageresources.java

?? webwork study w ebwork study
?? JAVA
字號:
package jaction.utility;


import java.io.InputStream;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.Locale;
import java.util.Properties;


/**
 * Concrete subclass of <code>MessageResources</code> that reads message keys
 * and corresponding strings from named property resources in the same manner
 * that <code>java.util.PropertyResourceBundle</code> does.  The
 * <code>base</code> property defines the base property resource name, and
 * must be specified.
 * <p>
 * <strong>IMPLEMENTATION NOTE</strong> - This class trades memory for
 * speed by caching all messages located via generalizing the Locale under
 * the original locale as well.
 * This results in specific messages being stored in the message cache
 * more than once, but improves response time on subsequent requests for
 * the same locale + key combination.
 *
 * @author Craig R. McClanahan
 * @version $Revision: 1.3 $ $Date: 2001/02/12 00:32:14 $
 */

public class PropertyMessageResources extends MessageResources {


    // ----------------------------------------------------------- Constructors


    /**
     * Construct a new PropertyMessageResources according to the
     * specified parameters.
     *
     * @param factory The MessageResourcesFactory that created us
     * @param config The configuration parameter for this MessageResources
     */
    public PropertyMessageResources(MessageResourcesFactory factory,
                                    String config) {

        super(factory, config);

    }


    /**
     * Construct a new PropertyMessageResources according to the
     * specified parameters.
     *
     * @param factory The MessageResourcesFactory that created us
     * @param config The configuration parameter for this MessageResources
     * @param returnNull The returnNull property we should initialize with
     */
    public PropertyMessageResources(MessageResourcesFactory factory,
                                    String config, boolean returnNull) {

        super(factory, config, returnNull);

    }


    // ------------------------------------------------------------- Properties


    /**
     * The set of locale keys for which we have already loaded messages, keyed
     * by the value calculated in <code>localeKey()</code>.
     */
    protected HashMap locales = new HashMap();


    /**
     * The cache of messages we have accumulated over time, keyed by the
     * value calculated in <code>messageKey()</code>.
     */
    protected HashMap messages = new HashMap();


    // --------------------------------------------------------- Public Methods


    /**
     * Returns a text message for the specified key, for the default Locale.
     * A null string result will be returned by this method if no relevant
     * message resource is found for this key or Locale, if the
     * <code>returnNull</code> property is set.  Otherwise, an appropriate
     * error message will be returned.
     * <p>
     * This method must be implemented by a concrete subclass.
     *
     * @param locale The requested message Locale, or <code>null</code>
     *  for the system default Locale
     * @param key The message key to look up
     */
    public String getMessage(Locale locale, String key) {

        // Initialize variables we will require
        String localeKey = localeKey(locale);
        String originalKey = messageKey(localeKey, key);
        String messageKey = null;
        String message = null;
        int underscore = 0;
        boolean addIt = false;  // Add if not found under the original key

        // Loop from specific to general Locales looking for this message
        while (true) {

            // Load this Locale's messages if we have not done so yet
            loadLocale(localeKey);

            // Check if we have this key for the current locale key
            messageKey = messageKey(localeKey, key);
            synchronized (messages) {
                message = (String) messages.get(messageKey);
                if (message != null) {
                    if (addIt)
                        messages.put(originalKey, message);
                    return (message);
                }
            }

            // Strip trailing modifiers to try a more general locale key
            addIt = true;
            underscore = localeKey.lastIndexOf("_");
            if (underscore < 0)
                break;
            localeKey = localeKey.substring(0, underscore);

        }

        // Try the default locale if the current locale is different
        if (!defaultLocale.equals(locale)) {
            localeKey = localeKey(defaultLocale);
            messageKey = messageKey(localeKey, key);
            loadLocale(localeKey);
            synchronized (messages) {
                message = (String) messages.get(messageKey);
                if (message != null) {
                    if (addIt)
                        messages.put(originalKey, message);
                    return (message);
                }
            }
        }

        // As a last resort, try the default Locale
        localeKey = "";
        messageKey = messageKey(localeKey, key);
        loadLocale(localeKey);
        synchronized (messages) {
            message = (String) messages.get(messageKey);
            if (message != null) {
                if (addIt)
                    messages.put(originalKey, message);
                return (message);
            }
        }

        // Return an appropriate error indication
        if (returnNull)
            return (null);
        else
            return ("???" + messageKey(locale, key) + "???");

    }


    // ------------------------------------------------------ Protected Methods


    /**
     * Load the messages associated with the specified Locale key.  For this
     * implementation, the <code>config</code> property should contain a fully
     * qualified package and resource name, separated by periods, of a series
     * of property resources to be loaded from the class loader that created
     * this PropertyMessageResources instance.  This is exactly the same name
     * format you would use when utilizing the
     * <code>java.util.PropertyResourceBundle</code> class.
     *
     * @param localeKey Locale key for the messages to be retrieved
     */
    protected void loadLocale(String localeKey) {

        // Have we already attempted to load messages for this locale?
        synchronized (locales) {
            if (locales.get(localeKey) != null)
                return;
            locales.put(localeKey, localeKey);
        }

        // Set up to load the property resource for this locale key, if we can
        String name = config.replace('.', '/');
        if (localeKey.length() > 0)
            name += "_" + localeKey;
        name += ".properties";
        InputStream is = null;
        Properties props = new Properties();

        // Load the specified property resource
        try {
            is = this.getClass().getClassLoader().getResourceAsStream(name);
            if (is != null) {
                props.load(is);
                is.close();
            }
        } catch (Throwable t) {
            if (is != null) {
                try {
                    is.close();
                } catch (Throwable u) {
                    ;
                }
            }
        }

        // Copy the corresponding values into our cache
        if (props.size() < 1)
            return;
        synchronized (messages) {
            Enumeration names = props.keys();
            while (names.hasMoreElements()) {
                String key = (String) names.nextElement();
                messages.put(messageKey(localeKey, key),
                             props.getProperty(key));
            }
        }

    }


}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久众筹精品私拍模特| 国产成人精品免费在线| 在线观看日韩精品| 亚洲女同ⅹxx女同tv| 91免费视频网址| 亚洲日本免费电影| 色综合视频在线观看| 一级做a爱片久久| 欧美日韩一区二区三区视频| 尤物在线观看一区| 91精品国产入口| 精品影视av免费| 一区二区欧美在线观看| 欧美日韩精品一区二区| 日本中文字幕一区二区有限公司| 欧美日韩高清不卡| 久久精品国产99国产| 久久久久久黄色| 972aa.com艺术欧美| 亚洲国产日韩综合久久精品| 69堂国产成人免费视频| 国内外成人在线| 国产精品二三区| 欧美丝袜丝交足nylons| 蜜臀av一区二区| 中文在线免费一区三区高中清不卡 | 美女被吸乳得到大胸91| 久久久精品黄色| 一本一道波多野结衣一区二区| 视频在线观看一区| 国产亚洲一二三区| 欧美在线视频全部完| 极品美女销魂一区二区三区免费| 国产亚洲欧美一级| 欧美日韩一卡二卡三卡| 国内成人自拍视频| 亚洲黄色免费网站| 精品粉嫩aⅴ一区二区三区四区| 成人免费毛片嘿嘿连载视频| 亚洲国产综合在线| 久久久国产精品不卡| 欧美亚洲一区三区| 国产精品香蕉一区二区三区| 一区二区三区电影在线播| 欧美精品一区二区久久婷婷| 一本大道久久a久久综合婷婷| 秋霞午夜av一区二区三区| 国产精品激情偷乱一区二区∴| 在线成人午夜影院| 91视频一区二区三区| 国内外成人在线| 性做久久久久久| 国产精品久久久一本精品| 欧美一区二区精品在线| 色av成人天堂桃色av| 国产成人精品在线看| 日韩精彩视频在线观看| 亚洲欧美日韩在线| 国产亚洲va综合人人澡精品| 制服丝袜在线91| 色美美综合视频| 成人一区在线看| 精品一区二区三区视频在线观看| 亚洲电影一区二区| 日韩久久一区二区| 国产精品丝袜黑色高跟| 26uuu亚洲| 精品女同一区二区| 欧美变态口味重另类| 欧美精品tushy高清| 欧美日韩黄色一区二区| 色94色欧美sute亚洲线路一ni| av成人免费在线观看| 国产69精品久久99不卡| 精品一区二区三区日韩| 日本aⅴ免费视频一区二区三区| 一区二区三区四区高清精品免费观看 | 日韩视频一区在线观看| 欧美三级乱人伦电影| 欧美综合亚洲图片综合区| 91美女在线看| 欧美午夜片在线看| 欧美色精品在线视频| 欧美性受xxxx黑人xyx性爽| 91福利视频久久久久| 色欧美乱欧美15图片| 欧美色视频一区| 欧美日韩国产一二三| 欧美人伦禁忌dvd放荡欲情| 欧美日韩精品一区二区三区 | 成人激情图片网| 国产成人av一区二区三区在线观看| 国产最新精品精品你懂的| 国产一区二区主播在线| 国产成人高清在线| 成人av先锋影音| 色激情天天射综合网| 在线精品视频小说1| 欧美性xxxxx极品少妇| 欧美日本国产视频| 精品国产乱码久久久久久闺蜜| 精品美女被调教视频大全网站| 久久久噜噜噜久噜久久综合| 国产精品久久久久一区| 亚洲欧美成人一区二区三区| 性久久久久久久久久久久| 免播放器亚洲一区| 成人国产精品免费观看视频| 91色porny| 日韩丝袜美女视频| 久久久精品tv| 亚洲综合久久久| 精品在线一区二区三区| 99精品视频一区二区三区| 欧美亚洲禁片免费| 精品国产乱码久久久久久久| 中文字幕一区在线| 视频在线观看国产精品| 国产成人免费xxxxxxxx| 欧洲视频一区二区| 精品动漫一区二区三区在线观看| 中文字幕在线观看不卡| 日日夜夜精品免费视频| 粉嫩久久99精品久久久久久夜| 91久久国产综合久久| 久久亚洲精品国产精品紫薇| 一区二区三区资源| 国产精品一二三四五| 欧美日韩中文一区| 亚洲国产精品黑人久久久| 婷婷开心激情综合| 91影院在线观看| 久久久国际精品| 日产国产高清一区二区三区| 97久久人人超碰| 欧美精品一区二区三区高清aⅴ | 不卡的av在线播放| 欧美高清激情brazzers| 成人免费在线视频| 国产乱人伦偷精品视频免下载| 在线视频综合导航| 国产网站一区二区| 日日骚欧美日韩| 色综合欧美在线| 精品久久99ma| 日本中文一区二区三区| av网站一区二区三区| 日韩欧美一区在线| 2020国产精品自拍| 午夜在线成人av| av动漫一区二区| 久久午夜色播影院免费高清 | 精品国产在天天线2019| **性色生活片久久毛片| 久久精品国产精品青草| 色狠狠一区二区| 4438x成人网最大色成网站| 亚洲成人黄色影院| 国产成人精品网址| 欧美一区二区福利在线| 亚洲欧美偷拍另类a∨色屁股| 国产成人av电影| 欧美tickling网站挠脚心| 亚洲黄色小视频| 成人av集中营| 久久综合色婷婷| 亚洲女性喷水在线观看一区| 99精品视频免费在线观看| 久久精品亚洲一区二区三区浴池| 天天做天天摸天天爽国产一区 | 日本在线不卡视频一二三区| 日本韩国精品一区二区在线观看| 久久久久久久久99精品| 久久精品999| 欧美精品粉嫩高潮一区二区| 一区二区视频免费在线观看| 成人动漫在线一区| 国产精品素人一区二区| 国产成人精品一区二区三区四区| 精品久久久久久久久久久院品网 | 国产精品久久影院| 国产白丝精品91爽爽久久| 精品国产伦理网| 激情五月婷婷综合| 欧美大片顶级少妇| 蜜臀av一区二区三区| 日韩三级精品电影久久久 | 色成人在线视频| 亚洲视频综合在线| 91在线视频网址| 亚洲欧洲三级电影| 欧美日韩色一区| 日韩制服丝袜av| 日韩午夜av电影| 日韩高清不卡在线| 在线电影院国产精品| 日本亚洲天堂网| 精品免费国产一区二区三区四区| 国产成人av一区二区| 欧美高清在线一区二区|