Determines if the Parser service is active. When false, do not call parse(). Defaults to true. It does not block any methods (register, find, etc).
Determines if the Parser service is active. When false, do not call parse().
Sets up a function to lazy load the configuration when any of the other functions are called.
Services accessor. Note: Not passed into the constructor because this object should be created before ValidationServices itself. So it gets assigned when the associated service property on ValidationService is assigned the service instance.
Provides access to services.
Protected
loggerProvides an API for logging, sending entries to the loggerService.
Protected
indexUtility for register() to identify an already registered item that can be replaced by the supplied item.
an index into the getAll collection of a match or -1 if no match.
Parse the text supplied, attempting to create another value from it that will be returned. The new value may be a different data type, whether primitive or an object that you have registered with DataTypeIdentifier. If parsing fails, return an error message instead of a value. If the text is the empty string, it is up to the parser to determine what to do (return the empty string, null, a default value of the expected type, or an error message.) The implementation should not throw an exception for a parsing error. Exceptions are permitted for configuration errors, such as a missing culture. If no parser was available, it returns an error in DataTypeResolution.
A lookup key that identifies the desired parser. This is expected to come from the valueHost.parserLookupKey or if null, valueHost.dataType. If no parser is found for this, the LookupKeyFallbackService is used to find another to try.
Such as 'en-US' and 'en'
Protected
parseReturn a matching DataTypeParser or null. Runs the lazyloader if setup and the first search fails.
A list of all matching DataTypeParsers. Null when none are found.
Protected
updateChanges the services on all implementations of IServicesAccessor
Registers an instance of the interface supported by this service. It may replace an existing one, as determined by the subclass. Replace supported on: IDataTypeIdentifier
Protected
unregisterReturns the full collection.
Protected
ensureProtected
logProtected
hasGenerated using TypeDoc v0.25.12
A service for parsing strings into the native data type using IDataTypeParser instances.
This class is available on ValidationServices.dataTypeParserService.