|
||||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||
java.lang.Objectcn.dreampie.common.util.properties.Prop
public class Prop
Prop. Prop can load properties file from CLASSPATH or File object.
| 构造方法摘要 | |
|---|---|
Prop(File file)
Prop constructor. |
|
Prop(File file,
String encoding)
Prop constructor Example: Prop prop = new Prop(new File("/var/config/my_config.txt"), "UTF-8"); String userName = prop.get("userName"); |
|
Prop(String fileName)
Prop constructor. |
|
Prop(String fileName,
String encoding)
Prop constructor Example: Prop prop = new Prop("my_config.txt", "UTF-8"); String userName = prop.get("userName"); prop = new Prop("com/resty/file_in_sub_path_of_classpath.txt", "UTF-8"); String value = prop.get("key"); |
|
| 方法摘要 | |
|---|---|
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()
|
| 从类 java.lang.Object 继承的方法 |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| 构造方法详细信息 |
|---|
public Prop(String fileName)
Prop(String, String)
public Prop(String fileName,
String encoding)
fileName - the properties file's name in classpath or the sub directory of classpathencoding - the encodingpublic Prop(File file)
Prop(java.io.File, String)
public Prop(File file,
String encoding)
file - the properties File objectencoding - the encoding| 方法详细信息 |
|---|
public String get(String key)
public String get(String key,
String defaultValue)
public Integer getInt(String key)
public Integer getInt(String key,
Integer defaultValue)
public Long getLong(String key)
public Long getLong(String key,
Long defaultValue)
public Boolean getBoolean(String key)
public Boolean getBoolean(String key,
Boolean defaultValue)
public boolean containsKey(String key)
public Properties getProperties()
|
||||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||