Class ValidationEngine<T>
java.lang.Object
com.inductiveautomation.ignition.designer.gui.validation.ValidationEngine<T>
- Type Parameters:
T- the type of the value to validate
Engine for validating values of a given type. Validation is asynchronous, provide a callback
Consumer to the constructor to receive validation results, and progress of validation.
Validation terminates on the first invalid result.
This class is not thread-safe and should be used from the UI thread.
-
Constructor Summary
ConstructorsConstructorDescriptionValidationEngine(ViewModelSwingWorkerExecutor executor, List<Validator<T>> validators, Consumer<ValidationResult> validationResultConsumer) Create a new validation engine. -
Method Summary
Modifier and TypeMethodDescriptionvoidValidate the given value asynchronously.voidIndicate that validation is in progress.
-
Constructor Details
-
ValidationEngine
public ValidationEngine(ViewModelSwingWorkerExecutor executor, List<Validator<T>> validators, Consumer<ValidationResult> validationResultConsumer) Create a new validation engine.- Parameters:
validators- the validators to usevalidationResultConsumer- the consumer to receive validation results
-
-
Method Details
-
validate
Validate the given value asynchronously. The result will be sent to the consumer provided in the constructor.- Parameters:
value- the value to validate
-
validating
public void validating()Indicate that validation is in progress. This will send an "unvalidated" result to the consumer.
-