public class PropUtil extends Object
| Constructor and Description |
|---|
PropUtil() |
| Modifier and Type | Method and Description |
|---|---|
static String[] |
expSplit(String expr)
表达式拆分(拆成 name, def)
|
static String |
getByExp(Properties main,
Properties target,
String expr,
String refKey)
根据表达式获取配置值
|
static String |
getByExp(Properties main,
Properties target,
String expr,
String refKey,
boolean useDef)
根据表达式获取配置值
|
static String |
getByTml(Properties main,
Properties target,
String tml,
String refKey)
根据模板获取配置值
|
static String |
getByTml(Properties main,
Properties target,
String tml,
String refKey,
boolean useDef)
根据模板获取配置值
|
public static String[] expSplit(String expr)
expr - 兼容 ${key} or key or ${key:def} or key:defpublic static String getByExp(Properties main, Properties target, String expr, String refKey)
expr - 兼容 ${key} or key or ${key:def} or key:defpublic static String getByExp(Properties main, Properties target, String expr, String refKey, boolean useDef)
expr - 兼容 ${key} or key or ${key:def} or key:defuseDef - 是否使用默认值public static String getByTml(Properties main, Properties target, String tml, String refKey)
tml - 模板: ${key} 或 aaa${key}bbb 或 ${key:def}/cccpublic static String getByTml(Properties main, Properties target, String tml, String refKey, boolean useDef)
tml - 模板: ${key} 或 aaa${key}bbb 或 ${key:def}/cccuseDef - 是否使用默认值Copyright © 2025. All rights reserved.