NestedPlaceholderPart constructor
NestedPlaceholderPart(
- String text,
- List<
PlaceholderPart> keyParts, - List<
PlaceholderPart> ? defaultParts
A PlaceholderPart that represents a nested placeholder expression with optional fallback.
This is used to represent placeholders whose keys or fallbacks themselves contain inner placeholder expressions, such as:
#{#{env:dev.name}:#{default.value}}
In this example:
keyParts
would resolve#{env:dev.name}
defaultParts
would resolve#{default.value}
The resolution process:
- Resolves
keyParts
to get the final key. - Tries to resolve that key using resolveRecursively.
- If unresolved, tries
defaultParts
if provided. - If still unresolved, delegates to PlaceholderPartResolutionContext.handleUnresolvablePlaceholder.
This allows for recursive resolution and fallback substitution, enabling powerful and composable placeholder configurations.
Constructs a new NestedPlaceholderPart with the given text
,
keyParts
, and optional defaultParts
.
Implementation
NestedPlaceholderPart(super.text, this.keyParts, this.defaultParts);