Placeholders
Guidewire uses the following syntax for the placeholder in a configuration file:
-
${key:defaultValue}
In this string:
- key is an identifier that the Substitutor uses, in part, to query the ExternalConfigurationProviderPlugin plugin for the substitution value that replaces the placeholder.
- defaultValue is an optional default value to use for substitution if the query of the ExternalConfigurationProviderPlugin plugin does not return a value.
Separate the key and its default value with a colon. The initial curly brace
{ must follow the initial $ character directly, meaning
that there cannot be a space between the $ and the {
brace.
As PolicyCenter encounters a placeholder in a configuration
file:
- If the lookupValue method returns a value, PolicyCenter replaces the entire placeholder string with the returned value.
- If the lookupValue method does not return a value PolicyCenter uses the provided default value in the placeholder, if the default value exists.
Placeholder syntax
A placeholder must contain the following types only:
- Letters
- Digits
- Dots
- Underscores
As you construct a key, observe the following rules:
- A key cannot contain spaces.
- A key cannot start with a digit.
- A key cannot be an empty string (
${ }). - A key cannot contain special characters, such as $.
Also keep in mind:
- A default value is optional.
- A placeholder in an XML configuration file cannot span multiple nodes.
- A placeholder in a Java property file cannot span multiple properties.
Placeholder examples
The following are all examples of valid placeholders.
${key}- The placeholder contains a key value only.
${key:}- The placeholder contains an empty default value.
${key:defaultValue}- The placeholder contains both a key value and a default value.
${key:onlyFirstColon:counts:all:further:colons:are:part:of:default:value}- The placeholder contains a default value with multiple colons. The first colon indicates the beginning of the default string. Subsequent colons are part of the default value. For example, this can be a database URL in file database-config.xml.
${keyW1thAD1g1t}- The placeholder contains a key that contains a digit.
