Note omits percentSymbol for user experience with intellisense It can still be passed in and will be ignored.
Static
Readonly
badProtected
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
hasAll cultureIds that support the order and separator. Note that if there is language-specific culture and one that is not language specific but has the same local, you can define just the one for the local because the DataTypeParser service will search both language specific and language agnostic when the CultureService is setup with fallbacks.
Protected
stripAny special formatting strings that are meaningful to the user but can be discarded during parsing. Consider the currency symbol and percent symbol. Don't use this for negative character as once identified as negative, the all negative symbols are stripped prior to parsing and the resolved number is still negated.
Protected
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
applyProtected
getIn addition to matching by dataTypeLookupKey, it also requires the text to match a regular expression. The expression reflects the one or very few patterns that parse() expects to work with. By the time parse() is called, it knows the expression has the pattern and can simply work within the regexp results.
Protected
parseCalled from parse to handle the text, knowing it is not an empty string and has been trimmed.
Since 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.
Protected
initProtected
defaultHandles 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
cleanExpect the output to be setup for a regular expression that looks for either: digits + period + digits minus + digits + period + digits digits minus + digits Anything else will be rejected by the regular expression as invalid.
Protected
isProtected
responsibleResponsible for anything that cannot be a number and number patterns that conform to the current options, like have a currencysymbol only when its setup. When its a number that cannot work with the options, reject it so another registered number parser can deal with it. That way, the NumberParser doesn't try to handle what was intended for CurrencyParser or PercentageParser.
Protected
cannotProtected
createExpects the string to be: optional minus (in group named "neg") 1 or more digits, allowing for lead zeros (in group named "whole") optional period if period, optional 1 or more digits allowing for trailing zeros (in group named "decimal"). This resulting pattern should completely cover the text except for lead and trailing whitespace. After whitespace trimming, we should be able to use parseFloat or parseInt on the text.
Protected
processProtected
patternGenerated using TypeDoc v0.25.12
Parser for LookupKey.Currency. It supports decimal and integer values, both positive and negative.