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
.Collections
.Generic
;
19 using System
.Reflection
;
21 using Castle
.ActiveRecord
;
24 /// Model for [Any] association, a polymorphic association without common base class
27 public class AnyModel
: IVisitable
29 private readonly PropertyInfo prop
;
30 private readonly AnyAttribute anyAtt
;
31 private IList
<Any
.MetaValueAttribute
> metaValues
;
34 /// Initializes a new instance of the <see cref="AnyModel"/> class.
36 /// <param name="prop">The prop.</param>
37 /// <param name="anyAtt">Any att.</param>
38 public AnyModel(PropertyInfo prop
, AnyAttribute anyAtt
)
42 metaValues
= new List
<Any
.MetaValueAttribute
>();
46 /// Gets the property.
48 /// <value>The property.</value>
49 public PropertyInfo Property
55 /// Gets the [Any] attribute
57 /// <value>Any att.</value>
58 public AnyAttribute AnyAtt
60 get { return anyAtt; }
64 /// Gets or sets the meta values.
66 /// <value>The meta values.</value>
67 public IList
<Any
.MetaValueAttribute
> MetaValues
69 get { return metaValues; }
70 set { metaValues = value; }
73 #region IVisitable Members
76 /// Accepts the specified visitor and call the relevant IVisitor.Visit***() method
78 /// <param name="visitor">The visitor.</param>
79 public void Accept(IVisitor visitor
)
81 visitor
.VisitAny(this);