PlaceholderAbstractPart class abstract
Base class for all PlaceholderPart implementations that represent a segment of a parsed placeholder expression.
This class provides common functionality for handling the raw text of the part and recursive resolution of nested placeholders.
Concrete subclasses (e.g., PlaceholderTextPart, PlaceholderPart) must
implement resolution behavior by overriding resolve(...)
.
Example:
class PlaceholderPart extends AbstractPart {
final String key;
PlaceholderPart(this.key) : super('\#{#key}');
@override
String resolve(PartResolutionContext ctx) {
return resolveRecursively(ctx, key) ?? ctx.handleUnresolvablePlaceholder(key, text());
}
}
This class should not be used directly—extend it to define custom parts.
- Implemented types
- Implementers
Constructors
- PlaceholderAbstractPart(String _text)
-
Base class for all PlaceholderPart implementations that represent a segment
of a parsed placeholder expression.
const
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
resolve(
PlaceholderPartResolutionContext resolutionContext) → String -
Represents a segment or fragment of a placeholder expression.
inherited
-
resolveRecursively(
PlaceholderPartResolutionContext resolutionContext, String key) → String? -
Recursively resolves the placeholder identified by
key
using the providedresolutionContext
. -
text(
) → String -
Returns the raw textual representation of this part.
override
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited