Perform variable substitution in string
val
from the values of keys found in the
system properties.
The variable substitution delimeters are ${ and } .
For example, if the System properties contains "key=value", then the call
String s = OptionConverter.substituteVars( "Value of key is ${key}." );
will set the variable
s
to "Value of key is value.".
If no value could be found for the specified key, then the props
parameter is
searched, if the value could not be found there, then substitution defaults to the empty
string.
For example, if system propeties contains no value for the key "inexistentKey", then the call
String s = OptionConverter.subsVars( "Value of inexistentKey is [${inexistentKey}]" );
will set
s
to "Value of inexistentKey is []"
An
java.lang.IllegalArgumentExceptionis thrown if val
contains a start
delimeter "${" which is not balanced by a stop delimeter "}".
Author Avy Sharell