Protected
defaultSupplies the Condition's default Category
A unique identifier for the specific implementation, like "RequireText" or "Range". Its value appears in the IssueFound that comes from Validation, and in IssueFound that comes from retrieving a list of errors to display. It allows the consumer of both to correlate those instances with the specific condition. When defining conditions through a ConditionConfig, the Type property must be assigned with a valid ConditionType. This property always returns what the user supplied in the Config.conditionType, not the default conditiontype. That allows multiple instances of the same condition Class to participate in one validator's list of conditions, because each has a unique ConditionType.
Data that supports the business rule defined in evaluate(). Consider this immutable. Expect to create a new Condition instance if its data needs to be changed.
Helps identify the purpose of the Condition. Impacts:
Static
DefaultEvaluate a value using its business rule and configuration in the Config.
contains both the raw value from input field/element and the value resolved by data type. The evaluate function can use either. It should always return Undetermined if the value it gets is 'undefined' or no compatible with its requirements (like wrong data type). If the ConditionConfig.valueHostName is assigned, it will be used to retrieve the ValueHost from the Model, and this parameter is ignored. This parameter can be null, but the ConditionConfig will need to supply a ValueHostName to a value host instead.
Implementation for IMessageTokenSource. Conditions havea number of values that are appropriate for tokens on the ConditionConfig. Examples:
An array. If an empty array if there are no token to offer. This base class has no tokens to offer.
Protected
compareProtected
loggerProvides an API for logging, sending entries to the loggerService.
Protected
generateUtility to create a condition to use as a child condition. It uses the conditionFactory. If the factory throws an exception, it logs the error and returns a condition that always returns Undetermined to allow execution to continue.
Protected
tryConverts the given value and lookup key using the provided conversion lookup key. If the conversion fails, a warning log is generated. Takes no action if the conversionLookupKey is null.
The value to be converted.
The lookup key associated with the value. Often this should be assigned to valueHost.getDataType().
The conversion lookup key to be used for conversion. Often this comes from conversionLookupKey or secondConversionLookupKey found on the Config object.
The services
An object containing the converted value, lookup key, and a flag indicating if the conversion failed.
Optional
value?: anyOptional
lookupProtected
ensureProtected
logUtility to log when a conditionConfig property is incorrectly setup.
Protected
throwLogs the invalid property data and throws a CodingError.
The name of the invalid property.
The error message describing the invalid property data.
The value host services.
Protected
logReport a comparison error where the data types of the two values are mismatched.
Protected
logLogs a message indicating that the specified property lacks a value to evaluate.
The name of the property.
The value host services.
Protected
ensureSupports evaluate() implementations by checking the valueHost passed in is setup and if not, supplying one identified by ConditionConfig.valueHostName. ConditionConfig.valueHostName takes precidence over the valueHost passed in.
Protected
getA service to provide all ValueHostNames that have been assigned to this Condition's Config.
Generated using TypeDoc v0.25.12
Value 1 must be less than or equal Value 2. Both values are retrieved from ValueHosts.
Evaluates data types that do not support GreaterThan/LessThan as Undetermined