Nucleus .Net Core CMS

Conversion.ITokenReplacer Interface

Namespace: Nucleus.Abstractions.Conversion
Assembly: Nucleus.Abstractions.dll
Interface for token replacement services that can replace tokens in strings.
CanReplaceToken (String token)
Returns whether the token specified by token can be replaced by the token replacer.
Parameters
Name Type
token String
ListTokens ()
Lists all available tokens that can be replaced. This can be used for on-screen display in editor user interfaces.
ReplaceToken (String token, String format, String defaultValue)
Returns a replacement value for the specified token.
Parameters
Name Type
token String
format String
defaultValue String
Returns
The returned value may be null - if the defaultValue is null the return value can be null, and Conversion.ITokenReplacer implementations may return null for other reasons.
Remarks
Callers should call CanReplaceToken before calling ReplaceToken. Implementations of Conversion.ITokenReplacementHandler should catch and handle exceptions thrown by this method, so implementations of Conversion.ITokenReplacer may throw exceptions.