public class StringResolver extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
DELIM_START |
static String |
DELIM_STOP |
| Constructor and Description |
|---|
StringResolver() |
| Modifier and Type | Method and Description |
|---|---|
static String |
getSystemProperty(String key,
String def)
Very similar to
System.getProperty except that the
SecurityException is hidden. |
static boolean |
needsResolution(String string) |
static String |
substVars(String val,
Map props) |
static String |
substVars(String val,
Map props1,
Map props2)
Do variable substitution on a string to resolve ${x2} to the value of the
property x2.
|
static String |
substVars(String val,
Map props1,
Map props2,
String delimStart,
String delimStop) |
public static final String DELIM_START
public static final String DELIM_STOP
public static String getSystemProperty(String key, String def)
System.getProperty except that the
SecurityException is hidden.key - The key to search for.def - The default value to return.public static String substVars(String val, Map props1, Map props2) throws IllegalArgumentException
Properties prop = new Properties();
prop.put("test.name", "this is a name with ${test.xx}");
prop.put("test.xx", "again");
System.out.println(prop.get("test.name"));
will print this is a name with again
First it looks in the System properties, if none is found and a
Properties object is specified, it looks in the specified
Properties object. If two Properties objects are
specified, first it look in the first object. If none is found, it looks in
the second object.
IllegalArgumentExceptionpublic static String substVars(String val, Map props1, Map props2, String delimStart, String delimStop) throws IllegalArgumentException
IllegalArgumentExceptionpublic static String substVars(String val, Map props) throws IllegalArgumentException
IllegalArgumentExceptionpublic static boolean needsResolution(String string)
Copyright © 2023 Frank!Framework. All rights reserved.