resolve method
Resolves all parts into a single string using the provided resolutionContext
.
This method iterates through all the parts and delegates resolution to
each part using PlaceholderPart.resolveAll. If a PlaceholderResolutionException
occurs, it rethrows the exception with the unresolved text attached for context.
Example:
final value = ParsedValue('Hello, \#{user}!', [...]);
final result = value.resolve(context); // Resolves to 'Hello, Alice!'
Throws PlaceholderResolutionException if any placeholder could not be resolved.
Implementation
String resolve(PlaceholderPartResolutionContext resolutionContext) {
try {
return PlaceholderPart.resolveAll(parts, resolutionContext);
} on PlaceholderResolutionException catch (ex) {
throw ex.withValue(text);
}
}