|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.alibaba.dubbo.common.utils.ConfigUtils
public class ConfigUtils
| Method Summary | |
|---|---|
static void |
addProperties(Properties properties)
|
static int |
getPid()
|
static Properties |
getProperties()
|
static String |
getProperty(String key)
|
static String |
getProperty(String key,
String defaultValue)
|
static String |
getSystemProperty(String key)
系统环境变量 -> java命令参数-D |
static boolean |
isDefault(String value)
|
static boolean |
isEmpty(String value)
|
static boolean |
isNotEmpty(String value)
|
static Properties |
loadProperties(String fileName)
|
static Properties |
loadProperties(String fileName,
boolean allowMultiFile)
|
static Properties |
loadProperties(String fileName,
boolean allowMultiFile,
boolean optional)
Load properties file to Properties from class path. |
static List<String> |
mergeValues(Class<?> type,
String cfg,
List<String> def)
扩展点列表中插入缺省扩展点。 |
static String |
replaceProperty(String expression,
Map<String,String> params)
|
static void |
setProperties(Properties properties)
|
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static boolean isNotEmpty(String value)
public static boolean isEmpty(String value)
public static boolean isDefault(String value)
public static List<String> mergeValues(Class<?> type,
String cfg,
List<String> def)
扩展点列表支持
default,表示缺省扩展点插入的位置
-,表示剔除。 -foo1,剔除添加缺省扩展点foo1。-default,剔除添加所有缺省扩展点。
type - 扩展点类型cfg - 扩展点名列表def - 缺省的扩展点的列表
public static String replaceProperty(String expression,
Map<String,String> params)
public static Properties getProperties()
public static void setProperties(Properties properties)
public static void addProperties(Properties properties)
public static String getProperty(String key)
public static String getProperty(String key,
String defaultValue)
public static String getSystemProperty(String key)
key -
public static Properties loadProperties(String fileName)
public static Properties loadProperties(String fileName,
boolean allowMultiFile)
public static Properties loadProperties(String fileName,
boolean allowMultiFile,
boolean optional)
Properties from class path.
fileName - properties file name. for example: dubbo.properties, METE-INF/conf/foo.propertiesallowMultiFile - if false, throw IllegalStateException when found multi file on the class path.optional - is optional. if false, log warn when properties config file not found!s
Properties content. IllegalStateException - not allow multi-file, but multi-file exsit on class path.public static int getPid()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||