Package com.acanx.util.properties
Class OrderedProperties
java.lang.Object
com.acanx.util.properties.OrderedProperties
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetKeys()
获取所有键(可选功能)getProperty
(String key) 获取属性值的方法void
加载.properties配置文件void
load
(InputStream in) 加载.properties配置文件void
resortAndStore
(File propFile) 将属性按键排序后写入文件,非属性条目(注释、空行)保留原始顺序void
setProperty
(String key, String value) void
store
(OutputStream out)
-
Constructor Details
-
OrderedProperties
public OrderedProperties()
-
-
Method Details
-
load
加载.properties配置文件- Parameters:
file
- 文件- Throws:
IOException
- 异常
-
load
加载.properties配置文件- Parameters:
in
- 输入流- Throws:
IOException
- 异常
-
getProperty
获取属性值的方法- Parameters:
key
- 键- Returns:
- 值
-
getKeys
获取所有键(可选功能)- Returns:
- 键值集合
-
setProperty
- Parameters:
key
- 键value
- 值
-
store
- Parameters:
out
- 输出流- Throws:
IOException
- 异常
-
resortAndStore
将属性按键排序后写入文件,非属性条目(注释、空行)保留原始顺序- Parameters:
propFile
- 输出文件- Throws:
IOException
- 异常
-