1 // Copyright 2004-2007 Castle Project - http://www.castleproject.org/
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
7 // http://www.apache.org/licenses/LICENSE-2.0
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
15 namespace Castle
.Components
.Validator
18 using System
.Reflection
;
21 /// Abstracts a validation registry per <see cref="Type"/>.
23 public interface IValidatorRegistry
26 /// Gets all validators associated with a <see cref="Type"/>.
28 /// The validators returned are initialized.
31 /// <param name="validatorRunner">The validator runner.</param>
32 /// <param name="targetType">Target type.</param>
33 /// <param name="runWhen">Restrict the set returned to the phase specified</param>
34 /// <returns>A Validator array</returns>
35 IValidator
[] GetValidators(ValidatorRunner validatorRunner
, Type targetType
, RunWhen runWhen
);
38 /// Gets all validators associated with a property.
40 /// The validators returned are initialized.
43 /// <param name="validatorRunner">The validator runner.</param>
44 /// <param name="targetType">Target type.</param>
45 /// <param name="property">The property.</param>
46 /// <param name="runWhen">Restrict the set returned to the phase specified</param>
47 /// <returns>A Validator array</returns>
48 IValidator
[] GetValidators(ValidatorRunner validatorRunner
, Type targetType
, PropertyInfo property
, RunWhen runWhen
);
51 /// Gets the string from resource by key
53 /// <param name="key">The key.</param>
54 string GetStringFromResource(string key
);