From: Michael D. <mik...@us...> - 2005-01-13 20:55:39
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Property In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29445/NHibernate/Property Modified Files: BasicGetter.cs BasicPropertyAccessor.cs BasicSetter.cs FieldGetter.cs FieldSetter.cs IGetter.cs IPropertyAccessor.cs ISetter.cs NoSetterAccessor.cs Log Message: Fixed typo in Getter/Setter error messages. Added some xml comments. Index: NoSetterAccessor.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Property/NoSetterAccessor.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** NoSetterAccessor.cs 31 Dec 2004 21:56:35 -0000 1.2 --- NoSetterAccessor.cs 13 Jan 2005 20:55:16 -0000 1.3 *************** *** 1,6 **** namespace NHibernate.Property { /// <summary> ! /// Access the Property through the <c>get</c> to get the value /// and go directly to the Field to set the value. /// </summary> --- 1,8 ---- + using System; + namespace NHibernate.Property { /// <summary> ! /// Access the mapped property through a Property <c>get</c> to get the value /// and go directly to the Field to set the value. /// </summary> *************** *** 15,21 **** /// <summary> ! /// /// </summary> ! /// <param name="namingStrategy"></param> public NoSetterAccessor( IFieldNamingStrategy namingStrategy ) { --- 17,23 ---- /// <summary> ! /// Initializes a new instance of <see cref="NoSetterAccessor"/>. /// </summary> ! /// <param name="namingStrategy">The <see cref="IFieldNamingStrategy"/> to use.</param> public NoSetterAccessor( IFieldNamingStrategy namingStrategy ) { *************** *** 26,34 **** /// <summary> ! /// /// </summary> ! /// <param name="theClass"></param> ! /// <param name="propertyName"></param> ! /// <returns></returns> public IGetter GetGetter( System.Type theClass, string propertyName ) { --- 28,42 ---- /// <summary> ! /// Creates an <see cref="BasicGetter"/> to <c>get</c> the value from the Property. /// </summary> ! /// <param name="theClass">The <see cref="System.Type"/> to find the Property in.</param> ! /// <param name="propertyName">The name of the Property to get.</param> ! /// <returns> ! /// The <see cref="BasicGetter"/> to use to get the value of the Property from an ! /// instance of the <see cref="System.Type"/>.</returns> ! /// <exception cref="PropertyNotFoundException" > ! /// Thrown when a Property specified by the <c>propertyName</c> could not ! /// be found in the <see cref="System.Type"/>. ! /// </exception> public IGetter GetGetter( System.Type theClass, string propertyName ) { *************** *** 36,40 **** if( result == null ) { ! throw new PropertyNotFoundException( "Could not find a setter for property " + propertyName + " in class " + theClass.FullName ); } return result; --- 44,48 ---- if( result == null ) { ! throw new PropertyNotFoundException( "Could not find a getter for property " + propertyName + " in class " + theClass.FullName ); } return result; *************** *** 42,50 **** /// <summary> ! /// /// </summary> ! /// <param name="theClass"></param> ! /// <param name="propertyName"></param> ! /// <returns></returns> public ISetter GetSetter( System.Type theClass, string propertyName ) { --- 50,66 ---- /// <summary> ! /// Create a <see cref="FieldSetter"/> to <c>set</c> the value of the Property ! /// through a <c>field</c>. /// </summary> ! /// <param name="theClass">The <see cref="System.Type"/> to find the Property in.</param> ! /// <param name="propertyName">The name of the Property to set.</param> ! /// <returns> ! /// The <see cref="FieldSetter"/> to use to set the value of the Property on an ! /// instance of the <see cref="System.Type"/>. ! /// </returns> ! /// <exception cref="PropertyNotFoundException" > ! /// Thrown when a field for the Property specified by the <c>propertyName</c> using the ! /// <see cref="IFieldNamingStrategy"/> could not be found in the <see cref="System.Type"/>. ! /// </exception> public ISetter GetSetter( System.Type theClass, string propertyName ) { Index: FieldGetter.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Property/FieldGetter.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** FieldGetter.cs 31 Dec 2004 21:56:10 -0000 1.3 --- FieldGetter.cs 13 Jan 2005 20:55:16 -0000 1.4 *************** *** 4,8 **** namespace NHibernate.Property { ! /// <summary></summary> public sealed class FieldGetter : IGetter { --- 4,10 ---- namespace NHibernate.Property { ! /// <summary> ! /// An <see cref="IGetter"/> that uses a Field instead of the Property <c>get</c>. ! /// </summary> public sealed class FieldGetter : IGetter { *************** *** 12,20 **** /// <summary> ! /// /// </summary> ! /// <param name="field"></param> ! /// <param name="clazz"></param> ! /// <param name="name"></param> public FieldGetter( FieldInfo field, System.Type clazz, string name ) { --- 14,22 ---- /// <summary> ! /// Initializes a new instance of <see cref="FieldGetter"/>. /// </summary> ! /// <param name="clazz">The <see cref="System.Type"/> that contains the field to use for the Property <c>get</c>.</param> ! /// <param name="field">The <see cref="FieldInfo"/> for reflection.</param> ! /// <param name="name">The name of the Field.</param> public FieldGetter( FieldInfo field, System.Type clazz, string name ) { *************** *** 27,34 **** /// <summary> ! /// /// </summary> ! /// <param name="target"></param> ! /// <returns></returns> public object Get( object target ) { --- 29,38 ---- /// <summary> ! /// Gets the value of the Field from the object. /// </summary> ! /// <param name="target">The object to get the Field value from.</param> ! /// <returns> ! /// The value of the Field for the target. ! /// </returns> public object Get( object target ) { *************** *** 43,47 **** } ! /// <summary></summary> public System.Type ReturnType { --- 47,54 ---- } ! /// <summary> ! /// Gets the <see cref="System.Type"/> that the Field returns. ! /// </summary> ! /// <value>The <see cref="System.Type"/> that the Field returns.</value> public System.Type ReturnType { *************** *** 49,53 **** } ! /// <summary></summary> public string PropertyName { --- 56,63 ---- } ! /// <summary> ! /// Gets the name of the Property. ! /// </summary> ! /// <value><c>null</c> since this is a Field - not a Property.</value> public string PropertyName { *************** *** 55,59 **** } ! /// <summary></summary> public PropertyInfo Property { --- 65,72 ---- } ! /// <summary> ! /// Gets the <see cref="PropertyInfo"/> for the Property. ! /// </summary> ! /// <value><c>null</c> since this is a Field - not a Property.</value> public PropertyInfo Property { Index: IGetter.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Property/IGetter.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** IGetter.cs 31 Dec 2004 21:56:23 -0000 1.2 --- IGetter.cs 13 Jan 2005 20:55:16 -0000 1.3 *************** *** 4,37 **** { /// <summary> ! /// Gets values of a particular property /// </summary> public interface IGetter { /// <summary> ! /// Get the property value from the given instance /// </summary> ! /// <param name="target"></param> ! /// <returns></returns> object Get( object target ); /// <summary> ! /// Get the declared Type. /// </summary> ! /// <returns></returns> System.Type ReturnType { get; } /// <summary> ! /// Optional operation (return null) /// </summary> ! /// <returns></returns> string PropertyName { get; } /// <summary> ! /// Optional operation (return null) /// </summary> ! /// <returns></returns> /// <remarks> ! /// This is used to tell the Proxy which getter to intercept as the <id> ! /// property. /// </remarks> PropertyInfo Property { get; } --- 4,50 ---- { /// <summary> ! /// Gets values of a particular mapped property. /// </summary> public interface IGetter { /// <summary> ! /// When implemented by a class, gets the value of the Property/Field from the object. /// </summary> ! /// <param name="target">The object to get the Property/Field value from.</param> ! /// <returns> ! /// The value of the Property for the target. ! /// </returns> ! /// <exception cref="PropertyAccessException"> ! /// Thrown when there is a problem getting the value from the target. ! /// </exception> object Get( object target ); /// <summary> ! /// When implemented by a class, gets the <see cref="System.Type"/> that the Property/Field returns. /// </summary> ! /// <value>The <see cref="System.Type"/> that the Property returns.</value> System.Type ReturnType { get; } /// <summary> ! /// When implemented by a class, gets the name of the Property. /// </summary> ! /// <value>The name of the Property or <c>null</c>.</value> ! /// <remarks> ! /// This is an optional operation - if the <see cref="IGetter"/> is not ! /// for a Property <c>get</c> then <c>null</c> is an acceptable value to return. ! /// </remarks> string PropertyName { get; } /// <summary> ! /// When implemented by a class, gets the <see cref="PropertyInfo"/> for the Property. /// </summary> ! /// <value> ! /// The <see cref="PropertyInfo"/> for the Property. ! /// </value> /// <remarks> ! /// This is an optional operation - if the <see cref="IGetter"/> is not ! /// for a Property <c>get</c> then <c>null</c> is an acceptable value to return. ! /// It is used by the Proxies to determine which getter to intercept as the ! /// <id> property. /// </remarks> PropertyInfo Property { get; } Index: BasicGetter.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Property/BasicGetter.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** BasicGetter.cs 31 Dec 2004 21:55:37 -0000 1.2 --- BasicGetter.cs 13 Jan 2005 20:55:16 -0000 1.3 *************** *** 4,8 **** namespace NHibernate.Property { ! /// <summary></summary> public sealed class BasicGetter : IGetter { --- 4,10 ---- namespace NHibernate.Property { ! /// <summary> ! /// An <see cref="IGetter"/> for a Property <c>get</c>. ! /// </summary> public sealed class BasicGetter : IGetter { *************** *** 12,20 **** /// <summary> ! /// /// </summary> ! /// <param name="clazz"></param> ! /// <param name="property"></param> ! /// <param name="propertyName"></param> public BasicGetter( System.Type clazz, PropertyInfo property, string propertyName ) { --- 14,22 ---- /// <summary> ! /// Initializes a new instance of <see cref="BasicGetter"/>. /// </summary> ! /// <param name="clazz">The <see cref="System.Type"/> that contains the Property <c>get</c>.</param> ! /// <param name="property">The <see cref="PropertyInfo"/> for reflection.</param> ! /// <param name="propertyName">The name of the Property.</param> public BasicGetter( System.Type clazz, PropertyInfo property, string propertyName ) { *************** *** 27,34 **** /// <summary> ! /// /// </summary> ! /// <param name="target"></param> ! /// <returns></returns> public object Get( object target ) { --- 29,38 ---- /// <summary> ! /// Gets the value of the Property from the object. /// </summary> ! /// <param name="target">The object to get the Property value from.</param> ! /// <returns> ! /// The value of the Property for the target. ! /// </returns> public object Get( object target ) { *************** *** 43,47 **** } ! /// <summary></summary> public System.Type ReturnType { --- 47,54 ---- } ! /// <summary> ! /// Gets the <see cref="System.Type"/> that the Property returns. ! /// </summary> ! /// <value>The <see cref="System.Type"/> that the Property returns.</value> public System.Type ReturnType { *************** *** 49,53 **** } ! /// <summary></summary> public string PropertyName { --- 56,63 ---- } ! /// <summary> ! /// Gets the name of the Property. ! /// </summary> ! /// <value>The name of the Property.</value> public string PropertyName { *************** *** 55,59 **** } ! /// <summary></summary> public PropertyInfo Property { --- 65,74 ---- } ! /// <summary> ! /// Gets the <see cref="PropertyInfo"/> for the Property. ! /// </summary> ! /// <value> ! /// The <see cref="PropertyInfo"/> for the Property. ! /// </value> public PropertyInfo Property { Index: IPropertyAccessor.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Property/IPropertyAccessor.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** IPropertyAccessor.cs 31 Dec 2004 21:56:23 -0000 1.2 --- IPropertyAccessor.cs 13 Jan 2005 20:55:16 -0000 1.3 *************** *** 1,27 **** namespace NHibernate.Property { /// <summary> /// Abstracts the notion of a "property". Defines a strategy for accessing the ! /// value of an attribute. /// </summary> public interface IPropertyAccessor { /// <summary> ! /// Create a "getter" for the named attribute /// </summary> ! /// <param name="theClass"></param> ! /// <param name="propertyName"></param> ! /// <returns></returns> /// <exception cref="PropertyNotFoundException" > /// </exception> IGetter GetGetter( System.Type theClass, string propertyName ); /// <summary> ! /// Create a "setter" for the named attribute /// </summary> ! /// <param name="theClass"></param> ! /// <param name="propertyName"></param> ! /// <returns></returns> /// <exception cref="PropertyNotFoundException" > /// </exception> ISetter GetSetter( System.Type theClass, string propertyName ); --- 1,38 ---- + using System; + namespace NHibernate.Property { /// <summary> /// Abstracts the notion of a "property". Defines a strategy for accessing the ! /// value of a mapped property. /// </summary> public interface IPropertyAccessor { /// <summary> ! /// When implemented by a class, create a "getter" for the mapped property. /// </summary> ! /// <param name="theClass">The <see cref="System.Type"/> to find the Property in.</param> ! /// <param name="propertyName">The name of the Property to get.</param> ! /// <returns> ! /// The <see cref="IGetter"/> to use to get the value of the Property from an ! /// instance of the <see cref="System.Type"/>.</returns> /// <exception cref="PropertyNotFoundException" > + /// Thrown when a Property specified by the <c>propertyName</c> could not + /// be found in the <see cref="System.Type"/>. /// </exception> IGetter GetGetter( System.Type theClass, string propertyName ); /// <summary> ! /// When implemented by a class, create a "setter" for the mapped property. /// </summary> ! /// <param name="theClass">The <see cref="System.Type"/> to find the Property in.</param> ! /// <param name="propertyName">The name of the Property to set.</param> ! /// <returns> ! /// The <see cref="ISetter"/> to use to set the value of the Property on an ! /// instance of the <see cref="System.Type"/>. ! /// </returns> /// <exception cref="PropertyNotFoundException" > + /// Thrown when a Property specified by the <c>propertyName</c> could not + /// be found in the <see cref="System.Type"/>. /// </exception> ISetter GetSetter( System.Type theClass, string propertyName ); Index: ISetter.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Property/ISetter.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ISetter.cs 31 Dec 2004 21:56:23 -0000 1.2 --- ISetter.cs 13 Jan 2005 20:55:16 -0000 1.3 *************** *** 4,33 **** { /// <summary> ! /// Summary description for ISetter. /// </summary> public interface ISetter { /// <summary> ! /// Set the property value from the given instance /// </summary> ! /// <param name="target"></param> ! /// <param name="value"></param> ! /// <exception cref="HibernateException"> /// </exception> void Set( object target, object value ); /// <summary> ! /// Optional operation (return null) /// </summary> ! /// <returns></returns> string PropertyName { get; } /// <summary> ! /// Optional operation (return null) /// </summary> ! /// <returns></returns> /// <remarks> ! /// This is used to tell the Proxy which setter to intercept as the <id> ! /// property. /// </remarks> PropertyInfo Property { get; } --- 4,42 ---- { /// <summary> ! /// Sets values of a particular mapped property. /// </summary> public interface ISetter { /// <summary> ! /// When implemented by a class, sets the value of the Property/Field on the object. /// </summary> ! /// <param name="target">The object to set the Property value in.</param> ! /// <param name="value">The value to set the Property to.</param> ! /// <exception cref="PropertyAccessException"> ! /// Thrown when there is a problem setting the value in the target. /// </exception> void Set( object target, object value ); /// <summary> ! /// When implemented by a class, gets the name of the Property. /// </summary> ! /// <value>The name of the Property or <c>null</c>.</value> ! /// <remarks> ! /// This is an optional operation - if it is not implemented then ! /// <c>null</c> is an acceptable value to return. ! /// </remarks> string PropertyName { get; } /// <summary> ! /// When implemented by a class, gets the <see cref="PropertyInfo"/> for the Property. /// </summary> ! /// <value> ! /// The <see cref="PropertyInfo"/> for the Property. ! /// </value> /// <remarks> ! /// This is an optional operation - if it is not implemented then ! /// <c>null</c> is an acceptable value to return. It is used by ! /// the Proxies to determine which setter to intercept as the ! /// <id> property. /// </remarks> PropertyInfo Property { get; } Index: BasicPropertyAccessor.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Property/BasicPropertyAccessor.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** BasicPropertyAccessor.cs 31 Dec 2004 21:55:38 -0000 1.3 --- BasicPropertyAccessor.cs 13 Jan 2005 20:55:16 -0000 1.4 *************** *** 5,9 **** { /// <summary> ! /// Accesses property values via a get/set pair, which may be nonpublic. /// The default (and recommended strategy). /// </summary> --- 5,9 ---- { /// <summary> ! /// Accesses mapped property values via a get/set pair, which may be nonpublic. /// The default (and recommended strategy). /// </summary> *************** *** 15,29 **** /// <summary> ! /// /// </summary> ! /// <param name="type"></param> ! /// <param name="propertyName"></param> ! /// <returns></returns> ! public ISetter GetSetter( System.Type type, string propertyName ) { ! BasicSetter result = GetSetterOrNull( type, propertyName ); if( result == null ) { ! throw new PropertyNotFoundException( "Could not find a setter for property " + propertyName + " in class " + type.FullName ); } return result; --- 15,35 ---- /// <summary> ! /// Create a <see cref="BasicGetter"/> for the mapped property. /// </summary> ! /// <param name="theClass">The <see cref="System.Type"/> to find the Property in.</param> ! /// <param name="propertyName">The name of the Property to get.</param> ! /// <returns> ! /// The <see cref="BasicGetter"/> to use to get the value of the Property from an ! /// instance of the <see cref="System.Type"/>.</returns> ! /// <exception cref="PropertyNotFoundException" > ! /// Thrown when a Property specified by the <c>propertyName</c> could not ! /// be found in the <see cref="System.Type"/>. ! /// </exception> ! public IGetter GetGetter( System.Type theClass, string propertyName ) { ! BasicGetter result = GetGetterOrNull( theClass, propertyName ); if( result == null ) { ! throw new PropertyNotFoundException( "Could not find a getter for property " + propertyName + " in class " + theClass.FullName ); } return result; *************** *** 31,45 **** /// <summary> ! /// /// </summary> ! /// <param name="theClass"></param> ! /// <param name="propertyName"></param> ! /// <returns></returns> ! public IGetter GetGetter( System.Type theClass, string propertyName ) { ! BasicGetter result = GetGetterOrNull( theClass, propertyName ); if( result == null ) { ! throw new PropertyNotFoundException( "Could not find a setter for property " + propertyName + " in class " + theClass.FullName ); } return result; --- 37,58 ---- /// <summary> ! /// Create a <see cref="BasicSetter"/> for the mapped property. /// </summary> ! /// <param name="type">The <see cref="System.Type"/> to find the Property in.</param> ! /// <param name="propertyName">The name of the Property to get.</param> ! /// <returns> ! /// The <see cref="BasicSetter"/> to use to set the value of the Property on an ! /// instance of the <see cref="System.Type"/>. ! /// </returns> ! /// <exception cref="PropertyNotFoundException" > ! /// Thrown when a Property specified by the <c>propertyName</c> could not ! /// be found in the <see cref="System.Type"/>. ! /// </exception> ! public ISetter GetSetter( System.Type type, string propertyName ) { ! BasicSetter result = GetSetterOrNull( type, propertyName ); if( result == null ) { ! throw new PropertyNotFoundException( "Could not find a setter for property " + propertyName + " in class " + type.FullName ); } return result; *************** *** 49,120 **** /// <summary> ! /// /// </summary> ! /// <param name="type"></param> ! /// <param name="propertyName"></param> ! /// <returns></returns> ! internal static BasicSetter GetSetterOrNull( System.Type type, string propertyName ) { ! if( type == typeof( object ) || type == null ) { return null; } - //PropertyInfo property = type.GetProperty(propertyName); PropertyInfo property = type.GetProperty( propertyName, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.DeclaredOnly ); if( property != null ) { ! return new BasicSetter( type, property, propertyName ); } else { ! BasicSetter setter = GetSetterOrNull( type.BaseType, propertyName ); ! if( setter == null ) { System.Type[ ] interfaces = type.GetInterfaces(); ! for( int i = 0; setter == null && i < interfaces.Length; i++ ) { ! setter = GetSetterOrNull( interfaces[ i ], propertyName ); } } ! return setter; } - } /// <summary> ! /// /// </summary> ! /// <param name="type"></param> ! /// <param name="propertyName"></param> ! /// <returns></returns> ! internal static BasicGetter GetGetterOrNull( System.Type type, string propertyName ) { if( type == typeof( object ) || type == null ) { return null; } - //PropertyInfo property = type.GetProperty(propertyName); PropertyInfo property = type.GetProperty( propertyName, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.DeclaredOnly ); if( property != null ) { ! return new BasicGetter( type, property, propertyName ); } else { ! BasicGetter getter = GetGetterOrNull( type.BaseType, propertyName ); ! if( getter == null ) { System.Type[ ] interfaces = type.GetInterfaces(); ! for( int i = 0; getter == null && i < interfaces.Length; i++ ) { ! getter = GetGetterOrNull( interfaces[ i ], propertyName ); } } ! return getter; } - } } --- 62,150 ---- /// <summary> ! /// Helper method to find the Property <c>get</c>. /// </summary> ! /// <param name="type">The <see cref="System.Type"/> to find the Property in.</param> ! /// <param name="propertyName">The name of the Property to get.</param> ! /// <returns> ! /// The <see cref="BasicGetter"/> for the Property <c>get</c> or <c>null</c> ! /// if the Property could not be found. ! /// </returns> ! internal static BasicGetter GetGetterOrNull( System.Type type, string propertyName ) { ! ! if( type==typeof( object ) || type==null ) { + // the full inheritance chain has been walked and we could + // not find the Property get return null; } PropertyInfo property = type.GetProperty( propertyName, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.DeclaredOnly ); if( property != null ) { ! return new BasicGetter( type, property, propertyName ); } else { ! // recursively call this method for the base Type ! BasicGetter getter = GetGetterOrNull( type.BaseType, propertyName ); ! ! // didn't find anything in the base class - check to see if there is ! // an explicit interface implementation. ! if( getter == null ) { System.Type[ ] interfaces = type.GetInterfaces(); ! for( int i = 0; getter == null && i < interfaces.Length; i++ ) { ! getter = GetGetterOrNull( interfaces[ i ], propertyName ); } } ! return getter; } + } + /// <summary> ! /// Helper method to find the Property <c>set</c>. /// </summary> ! /// <param name="type">The <see cref="System.Type"/> to find the Property in.</param> ! /// <param name="propertyName">The name of the Property to set.</param> ! /// <returns> ! /// The <see cref="BasicSetter"/> for the Property <c>set</c> or <c>null</c> ! /// if the Property could not be found. ! /// </returns> ! internal static BasicSetter GetSetterOrNull( System.Type type, string propertyName ) { if( type == typeof( object ) || type == null ) { + // the full inheritance chain has been walked and we could + // not find the Property get return null; } PropertyInfo property = type.GetProperty( propertyName, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.DeclaredOnly ); if( property != null ) { ! return new BasicSetter( type, property, propertyName ); } else { ! // recursively call this method for the base Type ! BasicSetter setter = GetSetterOrNull( type.BaseType, propertyName ); ! ! // didn't find anything in the base class - check to see if there is ! // an explicit interface implementation. ! if( setter == null ) { System.Type[ ] interfaces = type.GetInterfaces(); ! for( int i = 0; setter == null && i < interfaces.Length; i++ ) { ! setter = GetSetterOrNull( interfaces[ i ], propertyName ); } } ! return setter; } } } Index: BasicSetter.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Property/BasicSetter.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** BasicSetter.cs 31 Dec 2004 21:55:38 -0000 1.2 --- BasicSetter.cs 13 Jan 2005 20:55:16 -0000 1.3 *************** *** 4,8 **** namespace NHibernate.Property { ! /// <summary></summary> public sealed class BasicSetter : ISetter { --- 4,10 ---- namespace NHibernate.Property { ! /// <summary> ! /// An <see cref="ISetter"/> for a Property <c>set</c>. ! /// </summary> public sealed class BasicSetter : ISetter { *************** *** 12,20 **** /// <summary> ! /// /// </summary> ! /// <param name="clazz"></param> ! /// <param name="property"></param> ! /// <param name="propertyName"></param> public BasicSetter( System.Type clazz, PropertyInfo property, string propertyName ) { --- 14,22 ---- /// <summary> ! /// Initializes a new instance of <see cref="BasicSetter"/>. /// </summary> ! /// <param name="clazz">The <see cref="System.Type"/> that contains the Property <c>set</c>.</param> ! /// <param name="property">The <see cref="PropertyInfo"/> for reflection.</param> ! /// <param name="propertyName">The name of the Property.</param> public BasicSetter( System.Type clazz, PropertyInfo property, string propertyName ) { *************** *** 27,34 **** /// <summary> ! /// /// </summary> ! /// <param name="target"></param> ! /// <param name="value"></param> public void Set( object target, object value ) { --- 29,39 ---- /// <summary> ! /// Sets the value of the Property on the object. /// </summary> ! /// <param name="target">The object to set the Property value in.</param> ! /// <param name="value">The value to set the Property to.</param> ! /// <exception cref="PropertyAccessException"> ! /// Thrown when there is a problem setting the value in the target. ! /// </exception> public void Set( object target, object value ) { *************** *** 43,47 **** } ! /// <summary></summary> public string PropertyName { --- 48,55 ---- } ! /// <summary> ! /// Gets the name of the Property. ! /// </summary> ! /// <value>The name of the Property or <c>null</c>.</value> public string PropertyName { *************** *** 49,53 **** } ! /// <summary></summary> public PropertyInfo Property { --- 57,64 ---- } ! /// <summary> ! /// Gets the <see cref="PropertyInfo"/> for the Property. ! /// </summary> ! /// <value>The <see cref="PropertyInfo"/> for the Property.</value> public PropertyInfo Property { Index: FieldSetter.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Property/FieldSetter.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** FieldSetter.cs 31 Dec 2004 21:56:10 -0000 1.2 --- FieldSetter.cs 13 Jan 2005 20:55:16 -0000 1.3 *************** *** 4,8 **** namespace NHibernate.Property { ! /// <summary></summary> public sealed class FieldSetter : ISetter { --- 4,10 ---- namespace NHibernate.Property { ! /// <summary> ! /// An <see cref="IGetter"/> that uses a Field instead of the Property <c>set</c>. ! /// </summary> public sealed class FieldSetter : ISetter { *************** *** 12,20 **** /// <summary> ! /// /// </summary> ! /// <param name="field"></param> ! /// <param name="clazz"></param> ! /// <param name="name"></param> public FieldSetter( FieldInfo field, System.Type clazz, string name ) { --- 14,22 ---- /// <summary> ! /// Initializes a new instance of <see cref="FieldSetter"/>. /// </summary> ! /// <param name="clazz">The <see cref="System.Type"/> that contains the Field to use for the Property <c>set</c>.</param> ! /// <param name="field">The <see cref="FieldInfo"/> for reflection.</param> ! /// <param name="name">The name of the Field.</param> public FieldSetter( FieldInfo field, System.Type clazz, string name ) { *************** *** 27,34 **** /// <summary> ! /// /// </summary> ! /// <param name="target"></param> ! /// <param name="value"></param> public void Set( object target, object value ) { --- 29,39 ---- /// <summary> ! /// Sets the value of the Field on the object. /// </summary> ! /// <param name="target">The object to set the Field value in.</param> ! /// <param name="value">The value to set the Field to.</param> ! /// <exception cref="PropertyAccessException"> ! /// Thrown when there is a problem setting the value in the target. ! /// </exception> public void Set( object target, object value ) { *************** *** 43,47 **** } ! /// <summary></summary> public string PropertyName { --- 48,55 ---- } ! /// <summary> ! /// Gets the name of the Property. ! /// </summary> ! /// <value><c>null</c> since this is a Field - not a Property.</value> public string PropertyName { *************** *** 49,53 **** } ! /// <summary></summary> public PropertyInfo Property { --- 57,64 ---- } ! /// <summary> ! /// Gets the <see cref="PropertyInfo"/> for the Property. ! /// </summary> ! /// <value><c>null</c> since this is a Field - not a Property.</value> public PropertyInfo Property { |