1
// Copyright 2004-2008 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
.ActiveRecord
.Framework
.Internal
18 using System
.Reflection
;
21 /// Gives a chance to external frameworks to plug into
22 /// the AR model builder process. Particularly useful to
23 /// inspect attributes and conventions outside the AR domain.
25 public interface IModelBuilderExtension
28 /// Gives implementors a chance to process the class.
30 /// <param name="type">The type.</param>
31 /// <param name="model">The model.</param>
32 void ProcessClass(Type type
, ActiveRecordModel model
);
35 /// Gives implementors a chance to process the property.
37 /// <param name="pi">The property info reflection object.</param>
38 /// <param name="model">The model.</param>
39 void ProcessProperty(PropertyInfo pi
, ActiveRecordModel model
);
42 /// Gives implementors a chance to process the field.
44 /// <param name="fi">The field info reflection object.</param>
45 /// <param name="model">The model.</param>
46 void ProcessField(FieldInfo fi
, ActiveRecordModel model
);
49 /// Gives implementors a chance to process the BelongsTo.
51 /// <param name="pi">The property info reflection object.</param>
52 /// <param name="belongsToModel">The belongs to model.</param>
53 /// <param name="model">The model.</param>
54 void ProcessBelongsTo(PropertyInfo pi
, BelongsToModel belongsToModel
, ActiveRecordModel model
);
57 /// Gives implementors a chance to process the HasMany.
59 /// <param name="pi">The property info reflection object.</param>
60 /// <param name="hasManyModel">The has many model.</param>
61 /// <param name="model">The model.</param>
62 void ProcessHasMany(PropertyInfo pi
, HasManyModel hasManyModel
, ActiveRecordModel model
);
65 /// Gives implementors a chance to process the HasManyToAny.
67 /// <param name="pi">The property info reflection object.</param>
68 /// <param name="hasManyModel">The has many model.</param>
69 /// <param name="model">The model.</param>
70 void ProcessHasManyToAny(PropertyInfo pi
, HasManyToAnyModel hasManyModel
, ActiveRecordModel model
);
73 /// Gives implementors a chance to process the HasAndBelongsToMany.
75 /// <param name="pi">The property info reflection object.</param>
76 /// <param name="hasAndBelongManyModel">The has and belong many model.</param>
77 /// <param name="model">The model.</param>
78 void ProcessHasAndBelongsToMany(PropertyInfo pi
, HasAndBelongsToManyModel hasAndBelongManyModel
, ActiveRecordModel model
);