public abstract class Substituters extends Object
| 限定符和类型 | 字段和说明 |
|---|---|
static String |
DEF_HOLDER_PREFIX
Default Holder prefix: "${" .
|
static String |
DEF_HOLDER_SUFFIX
Default Holder suffix: "}".
|
static int |
SYS_PROPS_MODE_FALLBACK
Check system properties if not resolvable in the specified properties.
|
static int |
SYS_PROPS_MODE_OVERRIDE
Check system properties first, before trying the specified properties.
|
| 构造器和说明 |
|---|
Substituters() |
| 限定符和类型 | 方法和说明 |
|---|---|
static String |
parse(String strVal)
Parse the given String value recursively, to be able to resolve
nested Holders (when resolved property values in turn contain
Holders again).
|
static String |
parse(String strVal,
boolean ignoreBadHolders)
Parse the given String value recursively, to be able to resolve
nested Holders (when resolved property values in turn contain
Holders again).
|
static String |
parse(String strVal,
Object props)
Parse the given String value recursively, to be able to resolve
nested Holders (when resolved property values in turn contain
Holders again).
|
static String |
parse(String strVal,
Object sub,
Object props) |
static String |
parse(String strVal,
Object props,
Set<String> visitedHolders,
boolean ignoreBadHolders)
Parse the given String value recursively, to be able to resolve
nested Holders (when resolved property values in turn contain
Holders again).
|
static boolean |
substringMatch(CharSequence str,
int index,
CharSequence substring)
Test whether the given string matches the given substring at the given index.
|
public static final String DEF_HOLDER_PREFIX
public static final String DEF_HOLDER_SUFFIX
public static final int SYS_PROPS_MODE_FALLBACK
public static final int SYS_PROPS_MODE_OVERRIDE
public static String parse(String strVal)
strVal - the String value to parsepublic static String parse(String strVal, Object props)
strVal - the String value to parseprops - the Properties to resolve Holders againstpublic static String parse(String strVal, boolean ignoreBadHolders)
strVal - the String value to parseignoreBadHolders - 是否忽略没有的占位符号public static String parse(String strVal, Object props, Set<String> visitedHolders, boolean ignoreBadHolders)
strVal - the String value to parseprops - the Properties to resolve Holders againstvisitedHolders - the Holders that have already been visitedignoreBadHolders - during the current resolution attempt (used to detect circular references
between Holders). Only non-null if we're parsing a nested Holder.public static boolean substringMatch(CharSequence str, int index, CharSequence substring)
str - the original string (or StringBuffer)index - the index in the original string to start matching againstsubstring - the substring to match at the given indexCopyright © 2018. All rights reserved.