| 构造器和说明 |
|---|
PropUtil() |
| 限定符和类型 | 方法和说明 |
|---|---|
static Map<String,String> |
getAllInfoToMap(Properties properties)
从配置文件中读取所有信息到map表中
|
static Properties |
getPropertyInfo(String fullFilePath)
获取指定位置的property文件中property文件信息
|
static String |
getValue(Properties properties,
String propertiesName)
获得properties文件里面指定属性名字的属性值,如果不存在该属性或者该属性的值为"",抛出异常
|
static String |
getValue(Properties properties,
String propertiesName,
String defaultValue)
获得properties文件里面指定属性名字的属性值,如果不存在该属性或者该属性的值为"",返回默认值
|
static List<String> |
getValueList(Properties properties,
String propertiesName)
通常在一个properties文件里面一个属性会有很多值,他们之间用','隔开,那么这个方法的作用就是获得所有的值
属性值为""的不加入返回的列表,如果属性值不存在或者所有的值都为"",抛出异常 |
public static Properties getPropertyInfo(String fullFilePath)
fullFilePath - property文件的全路径信息public static String getValue(Properties properties, String propertiesName)
properties - 给定的properties文件propertiesName - 属性名字public static String getValue(Properties properties, String propertiesName, String defaultValue)
properties - 给定的properties文件propertiesName - 属性名字defaultValue - 在属性值不存在或者为""的时候的返回的默认值public static List<String> getValueList(Properties properties, String propertiesName)
properties - 给定的properties文件propertiesName - 属性名字public static Map<String,String> getAllInfoToMap(Properties properties)
properties - Copyright © 2013. All Rights Reserved.