NestedPlaceholderPart constructor

NestedPlaceholderPart(
  1. String text,
  2. List<PlaceholderPart> keyParts,
  3. 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:

  1. Resolves keyParts to get the final key.
  2. Tries to resolve that key using resolveRecursively.
  3. If unresolved, tries defaultParts if provided.
  4. 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);