PlaceholderParsedValue class

A container for a parsed text and its constituent Part objects.

This class holds the original placeholder expression (text) and the parsed structure (parts) used to resolve dynamic placeholders in text.

You typically obtain a ParsedValue when parsing a template-like string with placeholders, such as:

final parsedValue = ParsedValue('\#{greeting}, \#{user}!', [
  LiteralPart(''),
  PlaceholderPart('greeting'),
  LiteralPart(', '),
  PlaceholderPart('user'),
  LiteralPart('!')
]);

final resolved = parsedValue.resolve(context); // e.g. 'Hello, Alice!'

It delegates the resolution of each part to the PlaceholderPart.resolveAll method and rethrows any PlaceholderResolutionException with additional context about the original unresolved value.

This class is commonly used internally by the placeholder resolution engine.

Constructors

PlaceholderParsedValue(String text, List<PlaceholderPart> parts)
A container for a parsed text and its constituent Part objects.

Properties

hashCode int
The hash code for this object.
no setterinherited
parts List<PlaceholderPart>
The parsed components (literal and placeholder parts) that make up the text.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
text String
The original raw text, including unresolved placeholders.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
resolve(PlaceholderPartResolutionContext resolutionContext) String
Resolves all parts into a single string using the provided resolutionContext.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited