StringValidatorAttribute Class

Summary

Used to indicate whether a string property should allow an empty string value or not.
Assembly
NAnt.Core.dll
Namespace
NAnt.Core.Attributes
Base Types
graph BT Type-->Base0["ValidatorAttribute"] click Base0 "/api/NAnt.Core.Attributes/ValidatorAttribute" Base0-->Base1["Attribute"] Type["StringValidatorAttribute"] class Type type-node

Syntax

[AttributeUsage(AttributeTargets.Property, Inherited = true)]
public sealed class StringValidatorAttribute : ValidatorAttribute

Attributes

Type Description
AttributeUsageAttribute

Constructors

Name Summary
StringValidatorAttribute() Initializes a new instance of the NAnt.Core.Attributes.StringValidatorAttribute class.

Properties

Name Value Summary
AllowEmpty bool
Gets or sets a value indicating whether an empty string or null should be a considered a valid value.
Expression string
Gets or sets a regular expression. The string will be validated to determine if it matches the expression.
ExpressionErrorMessage string
An optional error message that can be used to better describe the regular expression error.

Methods

Name Value Summary
Validate(Object) void
Checks if the specified value adheres to the rules defined by the properties of the NAnt.Core.Attributes.StringValidatorAttribute.