Abstract
Protected
optionsServices accessor. Note: Not passed into the constructor because this object should be created before ValidationServices itself. So it gets assigned when ValidationService.dataTypeFormatterService is assigned a value.
Provides access to services.
Protected
hasProtected
initProtected
assertIf 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.
Protected
Abstract
defaultSince there can be several parsers for a single lookupKey and cultureID that are selected based on the text, this function is used when you want all possible candidates. It is effectively supports() without the text.
Handles trimming and returning the emptyStringResult if that's what it has. Otherwise, it lets the child class work on the text.
Such as 'en-US' and 'en'
Protected
cleanChanges the text if needed before parsing. Usually removes unwanted characters like trimming whitespace, but it could try to fix the data to closely resemble the desired text pattern that will be parsed by parseCleanedText. When it comes to strings as the native data type, it can rework the text to be the pattern expected for storage. For example, you might store a US phone number in this pattern: [3 digits]-[3 digits]-[4 digits]. The user may enter it in another familiar pattern like "(413) 555-0521" or "413 555 0520". This would clean it up to the desired pattern of "413-555-0521".
Protected
applyProtected
Abstract
parseCalled from parse to handle the text, knowing it is not an empty string and has been trimmed.
Generated using TypeDoc v0.25.12
Abstract base class for creating IDataTypeParser implementations.
Use and extend the DataTypeParserOptions interface to contain the rules users will typically supply to customize the behavior. Options are generally parser guidance alone. Settings that are used by the supports() function should be stand-alone parameters of the constructor.
Base classes will also have constructor parameters separate from options that allow the subclass to dictate behavior.