Replaces all tokens in a message with a user friendly value. Tokens are single words within curley braces like {Label}. They are case insensitive.

Tokens can have an optional second part to identify a formatterKey. The syntax is {token:formatterkey}.

Legal characters in token and formatterkey are letters, digits, and underscore. These are matched case insensitively.

Some values are found in the Validator's ConditionConfig, such as the {Minimum} and {Maximum} of a RangeCondition. They need to be formatted according to the data type, such as "number" will convert 1000 into "1,000" and "date" will convert a javascript Date into "May 20, 2001". This function uses the ValidationServices to handle conversion and localization.

The "formatterkey" in {token:formatterkey} is actually the same as a LookupKey used to identify a data type. Tokens are supplied by implementers of IMessageTokenSource.

interface IMessageTokenResolverService {
    serviceName: string;
    services: IServices;
    dispose(): void;
    resolveTokens(message, valueHost, validationManager, ...hosts): string;
}

Hierarchy (view full)

Implemented by

Properties

serviceName: string
services: IServices

Provides access to services.

Methods

  • If the user needs to abandon this instance, they should use this to clean up active resources (like timers) and to release memory that would stall the garbage collector from disposing this object. It should assign any object reference to undefined as a strong indicator that the object has been disposed.

    Returns void

Generated using TypeDoc v0.25.12