/*********************************************************************
* All Rights reserved,Copyright (c) K-Opticom
**********************************************************************
*＜プログラム内容＞
*   システム名      ：eo顧客基幹システム
*   モジュール名    ：JCHAddressRuleListCache
*   ソースファイル名：JCHAddressRuleListCache.java
*   作成者          ：富士通
*   日付            ：2013年02月06日
*＜機能概要＞
*   住所編集用ルールリストキャッシュ部品です。
*＜修正履歴＞
*   バージョン  修正日       修正者      修正内容
*   v4.00.00    2013/02/06    FJ         新規作成
*	v5.00.00	2013/07/02    FJ）林	 プロパティファイル定義値を変更
*
**********************************************************************/

package eo.common.util;

import com.fujitsu.futurity.common.JCMPropertyCache;
import com.fujitsu.futurity.model.common.JCMAPLConstMgr;

public class JCHAddressRuleListCache extends JCMPropertyCache{

	/**
	 * アプリケーションプロパティファイルから、住所編集ルールリストファイルのパス
	 * 及び文字エンコード種別を取得し、シングルトンでインスタンス化します。
	 */
	public static void setPath()
	{
    	//アプリケーションプロパティファイルからアップロード定義ファイルのパスと文字エンコード種別を取得
		String filePath = JCMAPLConstMgr.getString("CH_PRC_ADDRESS_EDIT_FILE_PATH");
		String fileEncode = JCMAPLConstMgr.getString("CH_PRC_ADDRESS_EDIT_FILE_ENCODING");

		//シングルトンでインスタンス化
		JCHAddressRuleListCache rc = JCHAddressRuleListCache.getInstance();
		rc.PATH = filePath;
		rc.ENCODING = fileEncode;
	}

	/** インスタンス領域 */
	private static JCHAddressRuleListCache prop = null;

	/**
	 * インスタンス生成メソッド
	 * 
	 * @return prop
	 */
	private static JCHAddressRuleListCache getInstance()
	{
		if(prop == null)
		{
			prop = new JCHAddressRuleListCache();
		}
		
		return prop;
	}
	
	/**
	 * キーで指定された住所編集ルール情報を取得します。
	 * 
	 * @param key 定義ファイル設定値に対応するキー
	 * @return キーに紐付けられた定義ファイル内の設定値を格納したString
	 * @exception Exception
	 */
	public static String getValue(String key) throws Exception
	{
		return JCHAddressRuleListCache.getInstance().getValueProp(key);
	}
}
