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 something against the rules defined in the implementation. Return whether the data was consistent or violates the rules, or the data couldn't be used to run the rule.
Most values are found amongst the ValueHosts in the ValueHostsManager. Conditions can look them up using ValueHostsManager.getValueHost().getValue() or getInputValue(). This parameter is used as an optimization, both to avoid that lookup and to avoid the user typing in a ValueHostName when creating the Condition instance. Validator.validate() knows to pass the ValueHostName that hosts the Validator. Expect this to be null in other cases, such as when Condition is a child of the AllMatchCondition and its peers. In otherwords, support both ways.
Its primary use is to lookup ValueHosts to get their data.
Any of these values:
Evaluates the text from an Input that is actively being edited to determine if it violates the rules of this condition. However, this implementation is often very different from the implementation built around the native value. It works with a string value from the Input, and you aren't expected to retrieve any other value from a ValueHost host.
Current Input Value from InputValueHost. It has not been modified, so if you need to work with trimmed (lead and trail whitespace removed) text, you must take care of that yourself.
the ValueHost that invoked this.
just in case, your logic needs more info. However, if the data you need is constant, add a property to your condition's ConditionConfig to supply it.
Protected
loggerProvides an API for logging, sending entries to the loggerService.
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
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
For any input field/element whose native data is a string to determine if the required rule has been met or not, optionally require the absence of surrounding whitespace and optionally not null in native value. It has two evaluation features: