public class PropertiesProxy extends MultiLineProperties
maps
构造器和说明 |
---|
PropertiesProxy() |
PropertiesProxy(boolean utf8) |
PropertiesProxy(boolean utf8,
String... paths) |
PropertiesProxy(InputStream in) |
PropertiesProxy(Reader r) |
PropertiesProxy(String... paths) |
限定符和类型 | 方法和说明 |
---|---|
String |
check(String key) |
String |
get(String key) |
String |
get(String key,
String defaultValue) |
boolean |
getBoolean(String key) |
boolean |
getBoolean(String key,
boolean dfval) |
int |
getInt(String key) |
int |
getInt(String key,
int defaultValue) |
List<String> |
getKeys() |
List<String> |
getList(String key) |
List<String> |
getList(String key,
String separatorChar) |
long |
getLong(String key) |
long |
getLong(String key,
long dfval) |
String |
getTrim(String key) |
String |
getTrim(String key,
String defaultValue) |
Collection<String> |
getValues() |
boolean |
has(String key) |
PropertiesProxy |
joinAndClose(Reader r)
将另外一个 Properties 文本加入本散列表
|
PropertiesProxy |
joinByKey(String key)
根据自身的一个键对应的值扩展自身的属性。
|
<T> T |
make(Class<T> klass,
String prefix) |
PropertiesProxy |
set(String key,
String val) |
void |
setIgnoreResourceNotFound(boolean ignoreResourceNotFound) |
void |
setPaths(String... paths)
加载指定文件/文件夹的Properties文件,合并成一个Properties对象
如果有重复的key,请务必注意加载的顺序!!
|
Map<String,String> |
toMap() |
Properties |
toProperties() |
String |
trim(String key) |
String |
trim(String key,
String defaultValue) |
clear, containsKey, containsValue, entrySet, equals, get, hashCode, isEmpty, keys, keySet, load, load, print, print, put, putAll, remove, size, values
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
public PropertiesProxy()
public PropertiesProxy(boolean utf8, String... paths)
public PropertiesProxy(boolean utf8)
public PropertiesProxy(String... paths)
public PropertiesProxy(InputStream in)
public PropertiesProxy(Reader r)
r
- 文本输入流public void setPaths(String... paths)
如果有重复的key,请务必注意加载的顺序!!
paths
- 需要加载的Properties文件路径public void setIgnoreResourceNotFound(boolean ignoreResourceNotFound)
public boolean has(String key)
key
- 键public PropertiesProxy set(String key, String val)
public boolean getBoolean(String key)
public boolean getBoolean(String key, boolean dfval)
public int getInt(String key)
public int getInt(String key, int defaultValue)
public long getLong(String key)
public long getLong(String key, long dfval)
public Collection<String> getValues()
public Properties toProperties()
public PropertiesProxy joinByKey(String key)
本函数假设你可能有下面的键值:
... files: path/to_a.properties path/to_b.properties #End files那么如果你调用
joinByKey("files");
属性文件的路径可以是磁盘全路径,或者在 CLASSPATH 里的路径
key
- 键public PropertiesProxy joinAndClose(Reader r)
r
- 文本输入流Copyright © 2017. All rights reserved.