FormatPrinter<T> class abstract interface

An abstraction responsible for converting a strongly typed domain object or structural primitive into a localized, human-readable text string representation.

FormatPrinter separates presentation layout and localization requirements from internal data models. Implementations decode internal fields and structure them according to the formatting rules of a given Locale (e.g., handling numeric digit groupings, localized decimal points, calendar variant layouts, or gender/plural agreements).

Determinism and Error Management

Implementations should guarantee deterministic output streams based on the input object state and regional context configuration. If an un-printable object state is encountered, the engine should throw a structured runtime exception (e.g., FormatException) instead of emitting unsafe or corrupted string data.

Architecture Example

class LocalizedCurrencyPrinter implements FormatPrinter<double> {
  @override
  String print(double value, Locale locale) {
    // Evaluates locale coordinates to select currency symbols and placement rules
    return locale.getNormalizedLanguage() == 'en' ? '\$$value' : '$value €';
  }
}
Implementers
Annotations

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
print(T value, Locale locale) → String
Transforms the provided typed value state instance into a formatted, localized string representation matching the specified geographic or cultural locale criteria rules.
toString() → String
A string representation of this object.
inherited

Operators

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