Search in sources :

Example 6 with Validator

use of eu.esdihumboldt.util.validator.Validator in project hale by halestudio.

the class ValidationConstraintFactory method restore.

@Override
public ValidationConstraint restore(Value value, Definition<?> definition, TypeResolver typeIndex, ClassResolver resolver) throws Exception {
    Validator validator = value.as(ValidatorValue.class).toValidator();
    TypeDefinition type = (TypeDefinition) definition;
    return new ValidationConstraint(validator, type);
}
Also used : ValidationConstraint(eu.esdihumboldt.hale.common.schema.model.constraint.type.ValidationConstraint) ValidatorValue(eu.esdihumboldt.hale.common.schema.model.validate.factory.ValidatorValue) Validator(eu.esdihumboldt.util.validator.Validator) TypeDefinition(eu.esdihumboldt.hale.common.schema.model.TypeDefinition)

Aggregations

Validator (eu.esdihumboldt.util.validator.Validator)6 ValidationConstraint (eu.esdihumboldt.hale.common.schema.model.constraint.type.ValidationConstraint)4 TypeDefinition (eu.esdihumboldt.hale.common.schema.model.TypeDefinition)3 ArrayList (java.util.ArrayList)3 ValidatorValue (eu.esdihumboldt.hale.common.schema.model.validate.factory.ValidatorValue)2 AndValidator (eu.esdihumboldt.util.validator.AndValidator)2 OrValidator (eu.esdihumboldt.util.validator.OrValidator)2 Cell (eu.esdihumboldt.hale.common.align.model.Cell)1 Entity (eu.esdihumboldt.hale.common.align.model.Entity)1 Value (eu.esdihumboldt.hale.common.core.io.Value)1 ValueList (eu.esdihumboldt.hale.common.core.io.ValueList)1 IOMessageImpl (eu.esdihumboldt.hale.common.core.io.report.impl.IOMessageImpl)1 PropertyDefinition (eu.esdihumboldt.hale.common.schema.model.PropertyDefinition)1 TypeConstraint (eu.esdihumboldt.hale.common.schema.model.TypeConstraint)1 UnionValidationConstraint (eu.esdihumboldt.hale.io.xsd.reader.internal.constraint.UnionValidationConstraint)1 CombinedValidator (eu.esdihumboldt.util.validator.CombinedValidator)1 DigitCountValidator (eu.esdihumboldt.util.validator.DigitCountValidator)1 EnumerationValidator (eu.esdihumboldt.util.validator.EnumerationValidator)1 LengthValidator (eu.esdihumboldt.util.validator.LengthValidator)1 NumberValidator (eu.esdihumboldt.util.validator.NumberValidator)1