C# Class Castle.Components.Validator.AbstractValidator

Inheritance: IValidator
Exibir arquivo Open project: nats/castle-1.0.3-mono

Public Methods

Method Description
ApplyBrowserValidation ( BrowserValidationConfiguration config, InputElementType inputType, IBrowserValidationGenerator generator, IDictionary attributes, string target ) : void

Applies the browser validation by setting up one or more input rules on IBrowserValidationGenerator.

GetFieldOrPropertyValue ( object instance, string fieldOrPropertyName ) : object

Obtains the value of a property or field on a specific instance.

Initialize ( IValidatorRegistry validationRegistry, PropertyInfo property ) : void

Implementors should perform any initialization logic

IsValid ( object instance ) : bool

Implementors should perform the actual validation upon the property value

IsValid ( object instance, object fieldValue ) : bool

Implementors should perform the actual validation upon the property value

Protected Methods

Method Description
BuildErrorMessage ( ) : string

Builds the error message.

GetString ( string key ) : string

Gets the string from resource

Method Details

ApplyBrowserValidation() public method

Applies the browser validation by setting up one or more input rules on IBrowserValidationGenerator.
public ApplyBrowserValidation ( BrowserValidationConfiguration config, InputElementType inputType, IBrowserValidationGenerator generator, IDictionary attributes, string target ) : void
config BrowserValidationConfiguration The config.
inputType InputElementType Type of the input.
generator IBrowserValidationGenerator The generator.
attributes IDictionary The attributes.
target string The target.
return void

BuildErrorMessage() protected method

Builds the error message.
protected BuildErrorMessage ( ) : string
return string

GetFieldOrPropertyValue() public method

Obtains the value of a property or field on a specific instance.
public GetFieldOrPropertyValue ( object instance, string fieldOrPropertyName ) : object
instance object The instance to inspect.
fieldOrPropertyName string The name of the field or property to inspect.
return object

GetString() protected method

Gets the string from resource
protected GetString ( string key ) : string
key string The key.
return string

Initialize() public method

Implementors should perform any initialization logic
public Initialize ( IValidatorRegistry validationRegistry, PropertyInfo property ) : void
validationRegistry IValidatorRegistry
property System.Reflection.PropertyInfo The target property
return void

IsValid() public method

Implementors should perform the actual validation upon the property value
public IsValid ( object instance ) : bool
instance object The target type instance
return bool

IsValid() public abstract method

Implementors should perform the actual validation upon the property value
public abstract IsValid ( object instance, object fieldValue ) : bool
instance object The target type instance
fieldValue object The property/field value. It can be null.
return bool