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

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

?? resourcemanager.java

?? java swing控件
?? JAVA
字號:
/**
 * L2FProd.com Common Components 6.9.1 License.
 *
 * Copyright 2005-2006 L2FProd.com
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.l2fprod.common.util;

import java.text.MessageFormat;
import java.util.HashMap;
import java.util.Map;
import java.util.ResourceBundle;

/**
 * Manages application resources. <br>
 */
public class ResourceManager {

  static Map nameToRM = new HashMap();

  private ResourceBundle bundle;

  /**
   * Gets the ResourceManager associated with <code>clazz</code>.
   * It looks for a ResourceBundle named against the class name plus
   * the string "RB". For example, for the com.mypackage.Main, the
   * ResourceBundle com.mypackage.MainRB will be looked up.
   * 
   * @param clazz
   * @return the ResourceManager associated with the class
   */
  public static ResourceManager get(Class clazz) {
    String bundleName = clazz.getName() + "RB";
    return get(bundleName);
  }

  /**
   * Gets the ResourceManager with the given name.
   * 
   * @param bundleName
   * @return the ResourceManager with the given name.
   */
  public static ResourceManager get(String bundleName) {
    ResourceManager rm = (ResourceManager)nameToRM.get(bundleName);
    if (rm == null) {
      ResourceBundle rb = ResourceBundle.getBundle(bundleName);
      rm = new ResourceManager(rb);
      nameToRM.put(bundleName, rm);
    }
    return rm;
  }

  /**
   * @param clazz
   * @return the "AllRB" in the class package
   */
  public static ResourceManager all(Class clazz) {
    return get(getPackage(clazz) + ".AllRB");
  }

  /**
   * Gets the default ResourceManager. This is equivalent to
   * <code>all(ResourceManager.class)</code>. It returns the
   * ResourceManager named "AllRB" located in the same package
   * ResourceManager class (i.e com.l2fprod.common.util.AllRB).
   * 
   * @return the default ResourceManager
   */
  public static ResourceManager common() {
    return all(ResourceManager.class);
  }

  /**
   * Resolves any references to a resource bundle contained in
   * <code>rbAndProperty</code>. To reference a resource bundle
   * inside a property use <code>${com.package.FileRB:key}</code>,
   * this will look for <code>key</code> in the ResourceBundle
   * <code>com.package.FileRB</code>.
   * 
   * @param rbAndProperty
   * @return the resolved resource or rbAndProperty if no resource was
   *         found
   */
  public static String resolve(String rbAndProperty) {
    return common().resolve0(rbAndProperty);
  }

  /**
   * Same as {@link #resolve(String)} but once the value as been
   * resolved, a MessageFormatter is applied with the given
   * <code>args</code>.
   * 
   * @param rbAndProperty
   * @param args
   * @return the value for the resource parametrized by args
   */
  public static String resolve(String rbAndProperty, Object[] args) {
    String value = common().resolve0(rbAndProperty);
    return MessageFormat.format(value, args);
  }

  /**
   * Can't be directly constructed
   * 
   * @param bundle
   */
  private ResourceManager(ResourceBundle bundle) {
    this.bundle = bundle;
  }

  /**
   * Gets the String associated with <code>key</code> after having
   * resolved any nested keys ({@link #resolve(String)}).
   * 
   * @param key the key to lookup
   * @return the String associated with <code>key</code>
   */
  public String getString(String key) {
    return resolve0(String.valueOf(bundle.getObject(key)));
  }

  /**
   * Gets the String associated with <code>key</code> after having
   * resolved any nested keys ({@link #resolve(String)}) and applied
   * a formatter using the given <code>args</code>.
   * 
   * @param key the key to lookup
   * @param args the arguments to pass to the formatter
   * @return the String associated with <code>key</code>
   */
  public String getString(String key, Object[] args) {
    String value = getString(key);
    return MessageFormat.format(value, args);
  }

  /**
   * Gets the first character of the String associated with
   * <code>key</code>.
   * 
   * @param key the key to lookup
   * @return the first character of the String associated with
   *         <code>key</code>.
   */
  public char getChar(String key) {
    String s = getString(key);
    if (s == null || s.trim().length() == 0) {
      return (char)0;
    } else {
      return s.charAt(0);
    }
  }

  private String resolve0(String property) {
    String result = property;
    if (property != null) {
      int index = property.indexOf("${");
      if (index != -1) {
        int endIndex = property.indexOf("}", index);
        String sub = property.substring(index + 2, endIndex);
        // check if sub contains a reference to another RB, key
        int colon = sub.indexOf(":");
        if (colon != -1) {
          String rbName = sub.substring(0, colon);
          String keyName = sub.substring(colon + 1);
          sub = get(rbName).getString(keyName);
        } else {
          // it's a regular nested property
          sub = getString(sub);
        }
        result = property.substring(0, index) + sub
            + resolve0(property.substring(endIndex + 1));
      }
    }
    return result;
  }

  private static String getPackage(Class clazz) {
    String pck = clazz.getName();
    int index = pck.lastIndexOf('.');
    if (index != -1) {
      pck = pck.substring(0, index);
    } else {
      pck = "";
    }
    return pck;
  }

}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
一区二区在线免费观看| 国产精品女上位| 久久精子c满五个校花| 日本一区二区不卡视频| 青青草原综合久久大伊人精品 | 久久精品国产亚洲a| 一本色道久久综合亚洲91| 在线不卡免费av| 国产精品久久久久久久久快鸭 | 精品综合免费视频观看| 91在线你懂得| 欧美激情在线观看视频免费| 亚洲一二三区不卡| 成人影视亚洲图片在线| 日韩欧美国产一区在线观看| 亚洲欧美日韩国产另类专区| 精品亚洲aⅴ乱码一区二区三区| 免费观看在线综合色| 欧美丝袜第三区| 中文字幕日韩欧美一区二区三区| 精品国产乱子伦一区| 亚洲精品日韩专区silk| 久久久久久久久免费| 亚洲乱码中文字幕| 成人自拍视频在线| 久久亚洲精品国产精品紫薇| 午夜精品久久久久久久久| 男人的天堂久久精品| 欧美午夜宅男影院| 国产精品理论片在线观看| 狠狠v欧美v日韩v亚洲ⅴ| 精品日韩一区二区三区| 日韩电影免费在线看| 91福利在线免费观看| 亚洲另类在线一区| 国产成人av一区二区| 精品少妇一区二区三区视频免付费| 日日夜夜精品视频免费 | 一区二区三区在线免费视频| 欧美中文字幕一二三区视频| 综合av第一页| 波波电影院一区二区三区| 欧美精品一区二区三| 国产一区二区毛片| 精品福利二区三区| 老司机精品视频导航| 久久综合999| 精品亚洲aⅴ乱码一区二区三区| 日韩精品一区二区三区中文精品| 国模套图日韩精品一区二区| 日韩情涩欧美日韩视频| 久久国产精品色婷婷| 久久久亚洲精华液精华液精华液| 国产馆精品极品| 国产精品视频线看| 国产呦萝稀缺另类资源| 1024成人网| 一本久久a久久精品亚洲| 一区二区三区四区不卡在线| 欧美精品自拍偷拍| 蜜臀av国产精品久久久久| 精品国产自在久精品国产| 成人黄色小视频| 亚洲已满18点击进入久久| 欧美丰满少妇xxxxx高潮对白| 国产在线精品视频| 欧美不卡一区二区三区四区| 国产+成+人+亚洲欧洲自线| 中文字幕一区二区三区蜜月 | 欧美一区二区视频网站| 蜜桃视频第一区免费观看| 久久精品人人做人人爽人人| 91麻豆国产香蕉久久精品| 亚洲国产欧美日韩另类综合| 91精品婷婷国产综合久久竹菊| 日韩成人精品视频| 国产精品久久久久久久久图文区 | 成人黄色免费短视频| 久久精品一区四区| 欧美视频你懂的| 黄色成人免费在线| 一区2区3区在线看| 中文字幕一区二区三区四区不卡 | 精品国产一区二区三区久久影院| 国产成人亚洲精品青草天美| 最新中文字幕一区二区三区| 欧美变态凌虐bdsm| 一本色道久久综合精品竹菊 | 中国色在线观看另类| 欧美日韩国产高清一区二区三区 | 3d动漫精品啪啪| 成人a免费在线看| 性欧美大战久久久久久久久| 中文字幕一区av| 91精品国产色综合久久不卡蜜臀| 丁香激情综合国产| 久久国产日韩欧美精品| 亚洲黄色尤物视频| 国产日韩欧美精品在线| 欧美色图免费看| 成+人+亚洲+综合天堂| 久久精品国产成人一区二区三区| 国产亚洲欧洲一区高清在线观看| 日韩三区在线观看| 欧洲生活片亚洲生活在线观看| 国产成人在线免费观看| 日韩高清不卡一区二区三区| 亚洲天堂久久久久久久| 久久影视一区二区| 欧美成人猛片aaaaaaa| 欧美日韩国产片| 色综合久久久久综合体| 99久久99久久久精品齐齐 | 久久久欧美精品sm网站| 欧美亚洲一区三区| 色噜噜狠狠成人中文综合| 不卡一区二区中文字幕| 国内久久精品视频| 黄色小说综合网站| 另类人妖一区二区av| 亚洲地区一二三色| 国产精品国产馆在线真实露脸 | 国产米奇在线777精品观看| 午夜久久久影院| 亚洲成a人片在线观看中文| 水野朝阳av一区二区三区| 亚洲大片精品永久免费| 国产日韩欧美精品一区| 国产人成一区二区三区影院| 久久精品亚洲一区二区三区浴池| 日韩视频免费观看高清完整版在线观看 | 午夜精彩视频在线观看不卡| 久久久国产精品麻豆| 久久综合色天天久久综合图片| 久久久99免费| 国产精品理伦片| 亚洲精选免费视频| 香蕉av福利精品导航| 午夜不卡av免费| 日本中文字幕不卡| 国产精品一区在线观看你懂的| 国产一区在线不卡| 成人激情免费网站| 欧美一级片在线观看| 国产精品美女久久久久av爽李琼| 色偷偷久久一区二区三区| 欧美日韩一区二区三区不卡| 欧美久久一二三四区| 精品日韩在线观看| 中文字幕一区二区在线观看 | 91福利社在线观看| 欧美日本国产一区| 久久丝袜美腿综合| 亚洲人123区| 另类成人小视频在线| 成人av午夜影院| 欧美日韩中文一区| 久久蜜桃av一区精品变态类天堂| 亚洲激情在线激情| 精品午夜一区二区三区在线观看| 波多野结衣精品在线| 欧美一二三在线| 玉足女爽爽91| 懂色av中文字幕一区二区三区| 欧美日韩色一区| 成人免费一区二区三区在线观看 | 亚洲成a天堂v人片| 成人午夜免费视频| 欧美成人午夜电影| 亚洲高清免费观看高清完整版在线观看| 韩国一区二区视频| 欧美人伦禁忌dvd放荡欲情| 国产精品久线在线观看| 精品一二线国产| 欧美福利视频一区| 一区二区三区加勒比av| 国产成人免费视频精品含羞草妖精| 777a∨成人精品桃花网| 中文字幕一区二区三区四区| 久久se精品一区精品二区| 欧美日韩国产成人在线91| 亚洲人123区| 成人性视频网站| 久久先锋资源网| 奇米色一区二区| 欧美精品少妇一区二区三区| 亚洲黄色av一区| 99精品国产热久久91蜜凸| 国产情人综合久久777777| 国产麻豆精品在线| 欧美电影免费提供在线观看| 日韩精品一二区| 欧美巨大另类极品videosbest| 亚洲国产综合色| 欧美亚洲一区三区| 亚洲一级电影视频| 欧美亚洲综合另类| 亚洲成av人片一区二区| 欧美日韩在线不卡| 亚洲一区二区三区激情|