public class Config extends Object
| 构造器和说明 |
|---|
Config() |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
add(String location) |
Map<String,String> |
asMap() |
String |
get(String key) |
String |
get(String key,
String defaultValue) |
Boolean |
getBoolean(String key) |
Boolean |
getBoolean(String key,
boolean defaultValue) |
Double |
getDouble(String key) |
double |
getDouble(String key,
double defaultValue) |
Integer |
getInt(String key) |
Integer |
getInt(String key,
Integer defaultValue) |
Long |
getLong(String key) |
Long |
getLong(String key,
Long defaultValue) |
Config |
load(File file) |
Config |
load(Map<String,String> map) |
Config |
load(Properties props) |
static Config |
load(String location)
从文件路径或者classpath路径中载入配置.
|
Config |
load(String location,
javax.servlet.ServletContext sc) |
Config |
load(URL url) |
Config |
loadSystemEnvs() |
Config |
loadSystemProperties() |
public Config load(Properties props)
public static Config load(String location)
location - - 配置文件路径public void add(String location)
public Config loadSystemProperties()
public Config loadSystemEnvs()
public double getDouble(String key, double defaultValue)
Copyright © 2016. All rights reserved.