public class StringPropertyReplacer
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private static java.lang.String |
FILE_SEPARATOR
File separator value
|
private static java.lang.String |
FILE_SEPARATOR_ALIAS
File separator alias
|
private static int |
IN_BRACKET |
private static Log |
log |
static java.lang.String |
NEWLINE
New line string constant
|
private static int |
NORMAL |
private static java.lang.String |
PATH_SEPARATOR
Path separator value
|
private static java.lang.String |
PATH_SEPARATOR_ALIAS
Path separator alias
|
private static int |
SEEN_DOLLAR |
Constructor and Description |
---|
StringPropertyReplacer() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
replaceProperties(java.lang.String string)
Go through the input string and replace any occurance of ${p} with the
System.getProperty(p) value.
|
static java.lang.String |
replaceProperties(java.lang.String string,
java.util.Properties props)
Go through the input string and replace any occurance of ${p} with the
props.getProperty(p) value.
|
private static java.lang.String |
resolveCompositeKey(java.lang.String key,
java.util.Properties props)
Try to resolve a "key" from the provided properties by checking if it is
actually a "key1,key2", in which case try first "key1", then "key2".
|
private static final Log log
public static final java.lang.String NEWLINE
private static final java.lang.String FILE_SEPARATOR
private static final java.lang.String PATH_SEPARATOR
private static final java.lang.String FILE_SEPARATOR_ALIAS
private static final java.lang.String PATH_SEPARATOR_ALIAS
private static final int NORMAL
private static final int SEEN_DOLLAR
private static final int IN_BRACKET
public static java.lang.String replaceProperties(java.lang.String string)
string
- - the string with possible ${} referencespublic static java.lang.String replaceProperties(java.lang.String string, java.util.Properties props)
string
- - the string with possible ${} referencesprops
- - the source for ${x} property ref values, null means use
System.getProperty()private static java.lang.String resolveCompositeKey(java.lang.String key, java.util.Properties props)
key
- the key to resolveprops
- the properties to use