From: Michael D. <mik...@us...> - 2005-01-03 03:45:38
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Util In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16440/NHibernate/Util Modified Files: ReflectHelper.cs Log Message: Friendly exception thrown when a class is missing a default ctor. Index: ReflectHelper.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Util/ReflectHelper.cs,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** ReflectHelper.cs 1 Jan 2005 02:40:02 -0000 1.20 --- ReflectHelper.cs 3 Jan 2005 03:45:28 -0000 1.21 *************** *** 18,22 **** private static System.Type[ ] NoClasses = new System.Type[0]; - // private static System.Type[ ] Object = new System.Type[ ] {typeof( object )}; // not used !?! /// <summary> --- 18,21 ---- *************** *** 112,120 **** /// <summary> ! /// /// </summary> ! /// <param name="theClass"></param> ! /// <param name="name"></param> ! /// <returns></returns> public static IType ReflectedPropertyType( System.Type theClass, string name ) { --- 111,121 ---- /// <summary> ! /// Get the NHibernate <see cref="IType" /> for the named property of the <see cref="System.Type"/>. /// </summary> ! /// <param name="theClass">The <see cref="System.Type"/> to find the Property in.</param> ! /// <param name="name">The name of the property/field to find in the class.</param> ! /// <returns> ! /// The NHibernate <see cref="IType"/> for the named property. ! /// </returns> public static IType ReflectedPropertyType( System.Type theClass, string name ) { *************** *** 155,162 **** /// <summary> ! /// /// </summary> ! /// <param name="type"></param> ! /// <returns></returns> public static ConstructorInfo GetDefaultConstructor( System.Type type ) { --- 156,169 ---- /// <summary> ! /// Gets the default no arg constructor for the <see cref="System.Type"/>. /// </summary> ! /// <param name="type">The <see cref="System.Type"/> to find the constructor for.</param> ! /// <returns> ! /// The <see cref="ConstructorInfo"/> for the no argument constructor, or <c>null</c> if a ! /// default constructor could not be found. ! /// </returns> ! /// <exception cref="InstantiationException"> ! /// Thrown when there is a problem calling the method GetConstructor on <see cref="System.Type"/>. ! /// </exception> public static ConstructorInfo GetDefaultConstructor( System.Type type ) { *************** *** 170,174 **** catch( Exception ) { ! throw new PropertyNotFoundException( "Object class " + type.FullName + " must declare a default (no-arg) constructor" ); --- 177,181 ---- catch( Exception ) { ! throw new InstantiationException( "Object class " + type.FullName + " must declare a default (no-arg) constructor" ); *************** *** 177,184 **** /// <summary> ! /// /// </summary> ! /// <param name="type"></param> ! /// <returns></returns> public static bool IsAbstractClass( System.Type type ) { --- 184,191 ---- /// <summary> ! /// Determines if the <see cref="System.Type"/> is a non creatable class. /// </summary> ! /// <param name="type">The <see cref="System.Type"/> to check.</param> ! /// <returns><c>true</c> if the <see cref="System.Type"/> is an Abstract Class or an Interface.</returns> public static bool IsAbstractClass( System.Type type ) { |