$ character has special meaning only in front of {
i.e: ${my.var.name}
If alone, $ is (must be) harmless.
But one has to escape this harmless $ very hard :-(
Standalone $ eats too much escaping!
System.setProperty("test.key", " $ ");
assertEquals(" $ ", JProperties.config().getValue("test.key", String.class));// SmallRye Config
System.setProperty("test.key", " \\$ ");
assertEquals(" $ ", JProperties.config().getValue("test.key", String.class));
System.setProperty("test.key", " \\\\$ ");
assertEquals(" \\$ ", JProperties.config().getValue("test.key", String.class));
System.setProperty("test.key", " $$ ");
assertEquals(" $ ", JProperties.config().getValue("test.key", String.class));
System.setProperty("test.key", " \\$$ ");
assertEquals(" $$ ", JProperties.config().getValue("test.key", String.class));
System.setProperty("test.key", " \\\\$$ ");
assertEquals(" \\$$ ", JProperties.config().getValue("test.key", String.class));
Real world example:
macros.key.freemarker.format=\\$\\{%s}
Spring → "\$\{%s}"
SmallRye → "$\{%s}"
See also
#746
#1056
$character has special meaning only in front of{i.e:
${my.var.name}If alone,
$is (must be) harmless.But one has to escape this harmless
$very hard :-(Standalone
$eats too much escaping!Real world example:
macros.key.freemarker.format=\\$\\{%s}Spring →
"\$\{%s}"SmallRye →
"$\{%s}"See also
#746
#1056