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

📄 propertyutil.java

📁 struts+spring+hibernate自创框架
💻 JAVA
字号:
package com.pegasus.framework.util;

import java.io.FileInputStream;
import java.io.InputStream;
import java.util.Enumeration;
import java.util.Properties;

public class PropertyUtil {
	
	public static void generatePropertyJava(String propFileName) {
		InputStream in = null;
		try {
			in = new FileInputStream(propFileName);
			Properties prop = new Properties();
			prop.load(in);
			Enumeration en = prop.keys();
			while(en.hasMoreElements()) {
				String key = (String)en.nextElement();
				if(key.indexOf("error.uncatched.exception") != -1) {
					String value = key;
					key = key.replace(".","_");
					
					key = key.toUpperCase();
					String result = "";
					result = "public static final String " + key + " = \"" + value + "\";";
					System.out.println(result);
				}
				
			}
			
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
		
	}
	
	
	
	
	
	
	
	public static void main(String args[]) {
		generatePropertyJava("F:/comet/WORK/NS/site/project/framework/src/properties/Resources.properties");
	}
}

⌨️ 快捷键说明

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