C# Class Spring.Validation.BaseValidationAction

Abstract base class that should be extended by all validation actions.

This class implements template Execute method and defines OnValid and OnInvalid methods that can be overriden by specific validation actions.

Inheritance: IValidationAction
Afficher le fichier Open project: spring-projects/spring-net

Méthodes publiques

Méthode Description
BaseValidationAction ( ) : System

Initializes a new instance of the BaseValidationAction class.

Execute ( bool isValid, object validationContext, object>.IDictionary contextParams, IValidationErrors errors ) : void

Executes the action.

Méthodes protégées

Méthode Description
EvaluateWhen ( object rootContext, object>.IDictionary contextParams ) : bool

Evaluates 'when' expression.

OnInvalid ( object validationContext, object>.IDictionary contextParams, IValidationErrors errors ) : void

Called when associated validator is not valid.

OnValid ( object validationContext, object>.IDictionary contextParams, IValidationErrors errors ) : void

Called when associated validator is valid.

Method Details

BaseValidationAction() public méthode

Initializes a new instance of the BaseValidationAction class.
public BaseValidationAction ( ) : System
Résultat System

EvaluateWhen() protected méthode

Evaluates 'when' expression.
protected EvaluateWhen ( object rootContext, object>.IDictionary contextParams ) : bool
rootContext object Root context to use for expression evaluation.
contextParams object>.IDictionary Additional context parameters.
Résultat bool

Execute() public méthode

Executes the action.
public Execute ( bool isValid, object validationContext, object>.IDictionary contextParams, IValidationErrors errors ) : void
isValid bool Whether associated validator is valid or not.
validationContext object Validation context.
contextParams object>.IDictionary Additional context parameters.
errors IValidationErrors Validation errors container.
Résultat void

OnInvalid() protected méthode

Called when associated validator is not valid.
protected OnInvalid ( object validationContext, object>.IDictionary contextParams, IValidationErrors errors ) : void
validationContext object Validation context.
contextParams object>.IDictionary Additional context parameters.
errors IValidationErrors Validation errors container.
Résultat void

OnValid() protected méthode

Called when associated validator is valid.
protected OnValid ( object validationContext, object>.IDictionary contextParams, IValidationErrors errors ) : void
validationContext object Validation context.
contextParams object>.IDictionary Additional context parameters.
errors IValidationErrors Validation errors container.
Résultat void