⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 propertymanager.java

📁 这是一个用java做的超市管理项目,是一个真实的可用的项目,用Eclipse orcale9i 开发 jsp+javabean 适合大学生用于毕业论文 代码很清晰 导入数据即可用
💻 JAVA
字号:
package com.xdf.supermarket.util;

import java.util.MissingResourceException;
import java.util.ResourceBundle;

/**
 * @author hdyu
 *
 * To change the template for this generated type comment go to
 * Window>Preferences>Java>Code Generation>Code and Comments
 */
public class PropertyManager {
	private static final String CONFIG = "config";
	private static final ResourceBundle RESOURCE_BUNDLE =
		ResourceBundle.getBundle(CONFIG);
	/**
	 * 读取默认的config.properties文件
	 * @param key 
	 * @return value
	 */
	public static String getString(String key) {
		try {
			return RESOURCE_BUNDLE.getString(key);
		} catch (MissingResourceException e) {
			throw new RuntimeException( "! config : "+ key + '!');
		}
	}
	/**
	 * 读取指定为rb.properties文件
	 * @param rb property 文件,文件名为 rb.properties
	 * @param key 
	 * @return value
	 */
	public static String getRB(String rb, String key) throws Exception{
		try {
			return ResourceBundle.getBundle(rb).getString(key);
		} catch (MissingResourceException e) {
			throw new RuntimeException( '!' + rb + ":" + key + '!');
		}
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -