public class PropExt extends Object
| 限定符和类型 | 类和说明 |
|---|---|
static class |
PropExt.FileNotFoundException |
| 限定符和类型 | 字段和说明 |
|---|---|
protected Properties |
properties |
| 构造器和说明 |
|---|
PropExt()
支持 new PropExt().appendIfExists(
|
PropExt(Properties properties) |
PropExt(String fileName)
PropExt constructor.
|
PropExt(String fileName,
String encoding)
PropExt constructor
Example:
PropExt prop = new PropExt("my_config.txt", "UTF-8"); String userName = prop.get("userName"); prop = new PropExt("com/jfinal/file_in_sub_path_of_classpath.txt", "UTF-8"); String value = prop.get("key"); |
| 限定符和类型 | 方法和说明 |
|---|---|
PropExt |
append(PropExt prop) |
PropExt |
append(String fileName) |
PropExt |
append(String fileName,
String encoding) |
PropExt |
appendIfExists(String fileName) |
PropExt |
appendIfExists(String fileName,
String encoding) |
boolean |
containsKey(String key) |
String |
get(String key) |
String |
get(String key,
String defaultValue) |
Boolean |
getBoolean(String key) |
Boolean |
getBoolean(String key,
Boolean defaultValue) |
Integer |
getInt(String key) |
Integer |
getInt(String key,
Integer defaultValue) |
Long |
getLong(String key) |
Long |
getLong(String key,
Long defaultValue) |
Properties |
getProperties() |
boolean |
isEmpty() |
boolean |
notEmpty() |
protected Properties properties
public PropExt()
public PropExt(Properties properties)
public PropExt(String fileName)
PropExt(String, String)public PropExt(String fileName, String encoding)
Example:
PropExt prop = new PropExt("my_config.txt", "UTF-8");
String userName = prop.get("userName");
prop = new PropExt("com/jfinal/file_in_sub_path_of_classpath.txt", "UTF-8");
String value = prop.get("key");
fileName - the properties file's name in classpath or the sub directory of classpathencoding - the encodingpublic boolean containsKey(String key)
public boolean isEmpty()
public boolean notEmpty()
public Properties getProperties()
Copyright © 2019. All rights reserved.