/// <summary> /// Initializes a new instance of the <see cref="ValueAccessComparisonValidator"/> class. /// </summary> /// <param name="valueAccess">The <see cref="ValueAccess"/> to use when extracting the comparison operand.</param> /// <param name="comparisonOperator">The <see cref="ComparisonOperator"/> that specifies the kind of /// comparison to perform.</param> /// <param name="messageTemplate">The message template to use when logging validation failures.</param> /// <param name="negated">Indicates if the validation logic represented by the validator should be negated.</param> public ValueAccessComparisonValidator(ValueAccess valueAccess, ComparisonOperator comparisonOperator, string messageTemplate, bool negated) : this(valueAccess, comparisonOperator, messageTemplate, null, negated) { this.valueAccess = valueAccess; this.comparisonOperator = comparisonOperator; }
/// <summary> /// Initializes a new instance of the <see cref="ValueAccessComparisonValidator"/> class. /// </summary> /// <param name="valueAccess">The <see cref="ValueAccess"/> to use when extracting the comparison operand.</param> /// <param name="comparisonOperator">The <see cref="ComparisonOperator"/> that specifies the kind of /// comparison to perform.</param> /// <param name="messageTemplate">The message template to use when logging validation failures.</param> /// <param name="tag">The tag that describes the purpose of the validator.</param> public ValueAccessComparisonValidator(ValueAccess valueAccess, ComparisonOperator comparisonOperator, string messageTemplate, string tag) : this(valueAccess, comparisonOperator, messageTemplate, tag, false) { this.valueAccess = valueAccess; this.comparisonOperator = comparisonOperator; }
/// <summary> /// <para>Initializes a new instance of the <see cref="ValueAccessValidator"/> class with an upper bound constraint.</para> /// </summary> /// <param name="valueAccess">The <see cref="ValueAccess"/> to use when extracting values from the /// validated objects.</param> /// <param name="valueValidator">The <see cref="Validator"/> to use when validating the values extracted /// from the validated objects.</param> /// <exception cref="ArgumentNullException">when <paramref name="valueAccess"/> is <see langword="null"/>.</exception> /// <exception cref="ArgumentNullException">when <paramref name="valueValidator"/> is <see langword="null"/>.</exception> public ValueAccessValidator(ValueAccess valueAccess, Validator valueValidator) : base(null, null) { if (null == valueAccess) throw new ArgumentNullException("valueAccess"); if (null == valueValidator) throw new ArgumentNullException("valueValidator"); this.valueAccess = valueAccess; this.valueValidator = valueValidator; }
/// <summary> /// <para>Initializes a new instance of the <see cref="ValueAccessValidator"/> class with an upper bound constraint.</para> /// </summary> /// <param name="valueAccess">The <see cref="ValueAccess"/> to use when extracting values from the /// validated objects.</param> /// <param name="valueValidator">The <see cref="Validator"/> to use when validating the values extracted /// from the validated objects.</param> /// <exception cref="ArgumentNullException">when <paramref name="valueAccess"/> is <see langword="null"/>.</exception> /// <exception cref="ArgumentNullException">when <paramref name="valueValidator"/> is <see langword="null"/>.</exception> public ValueAccessValidator(ValueAccess valueAccess, Validator valueValidator) : base(null, null) { if (null == valueAccess) { throw new ArgumentNullException("valueAccess"); } if (null == valueValidator) { throw new ArgumentNullException("valueValidator"); } this.valueAccess = valueAccess; this.valueValidator = valueValidator; }
/// <summary> /// Initializes a new instance of the <see cref="ValueAccessComparisonValidator"/> class. /// </summary> /// <param name="valueAccess">The <see cref="ValueAccess"/> to use when extracting the comparison operand.</param> /// <param name="comparisonOperator">The <see cref="ComparisonOperator"/> that specifies the kind of /// comparison to perform.</param> /// <param name="messageTemplate">The message template to use when logging validation failures.</param> /// <param name="tag">The tag that describes the purpose of the validator.</param> /// <param name="negated">Indicates if the validation logic represented by the validator should be negated.</param> public ValueAccessComparisonValidator(ValueAccess valueAccess, ComparisonOperator comparisonOperator, string messageTemplate, string tag, bool negated) : base(messageTemplate, tag, negated) { if (valueAccess == null) { throw new ArgumentNullException("valueAccess"); } this.valueAccess = valueAccess; this.comparisonOperator = comparisonOperator; }
/// <summary> /// /// </summary> /// <param name="valueAccess"></param> /// <param name="validatedElement"></param> public ValueAccessValidatorBuilder(ValueAccess valueAccess, IValidatedElement validatedElement) : base(validatedElement) { this.valueAccess = valueAccess; }
/// <summary> /// Initializes a new instance of the <see cref="ValueAccessComparisonValidator"/> class. /// </summary> /// <param name="valueAccess">The <see cref="ValueAccess"/> to use when extracting the comparison operand.</param> /// <param name="comparisonOperator">The <see cref="ComparisonOperator"/> that specifies the kind of /// comparison to perform.</param> public ValueAccessComparisonValidator(ValueAccess valueAccess, ComparisonOperator comparisonOperator) : this(valueAccess, comparisonOperator, null, null) { }
/// <summary> /// Initializes a new instance of the <see cref="PropertyComparisonValidator"/> class. /// </summary> /// <param name="valueAccess">The <see cref="ValueAccess"/> to use to extract the value to compare.</param> /// <param name="comparisonOperator">The <see cref="ComparisonOperator"/> representing the kind of comparison to perform.</param> /// <param name="negated">Indicates if the validation logic represented by the validator should be negated.</param> public PropertyComparisonValidator(ValueAccess valueAccess, ComparisonOperator comparisonOperator, bool negated) : base(valueAccess, comparisonOperator, null, negated) { }
/// <summary> /// Initializes a new instance of the <see cref="PropertyComparisonValidator"/> class. /// </summary> /// <param name="valueAccess">The <see cref="ValueAccess"/> to use to extract the value to compare.</param> /// <param name="comparisonOperator">The <see cref="ComparisonOperator"/> representing the kind of comparison to perform.</param> public PropertyComparisonValidator(ValueAccess valueAccess, ComparisonOperator comparisonOperator) : base(valueAccess, comparisonOperator) { }