Fixing an issue where setting a custom property on a handler will not propagate it...
[castle.git] / Components / General / Validator / Castle.Components.Validator / IValidatorRegistry.cs
blob716880d2bae8770c29ad92f2adfef74e98df72d6
1 // Copyright 2004-2007 Castle Project - http://www.castleproject.org/
2 //
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
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
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
17 using System;
18 using System.Reflection;
20 /// <summary>
21 /// Abstracts a validation registry per <see cref="Type"/>.
22 /// </summary>
23 public interface IValidatorRegistry
25 /// <summary>
26 /// Gets all validators associated with a <see cref="Type"/>.
27 /// <para>
28 /// The validators returned are initialized.
29 /// </para>
30 /// </summary>
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);
37 /// <summary>
38 /// Gets all validators associated with a property.
39 /// <para>
40 /// The validators returned are initialized.
41 /// </para>
42 /// </summary>
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);
50 /// <summary>
51 /// Gets the string from resource by key
52 /// </summary>
53 /// <param name="key">The key.</param>
54 string GetStringFromResource(string key);