Example #1
0
        /// <summary>
        /// Gets the method defined by <code>name</code> and
        /// <code>params</code> for the Class <code>c</code>.
        /// </summary>
        /// <param name="c">Class in which the method search is taking place</param>
        /// <param name="name">Name of the method being searched for</param>
        /// <param name="parameters">An array of Objects (not Classes) that describe the the parameters</param>
        /// <returns>The desired Method object.</returns>
        public override MethodInfo GetMethod(Type c, String name, Object[] parameters)
        {
            // Just delegate to the base class
            try
            {
                return(base.GetMethod(c, name, parameters));
            }
            catch (AmbiguousException)
            {
                // whoops.  Ambiguous.  Make a nice log message and return null...
                String msg = string.Format("Introspection Error : Ambiguous method invocation {0}( ", name);

                for (int i = 0; i < parameters.Length; i++)
                {
                    if (i > 0)
                    {
                        msg = string.Format("{0}, ", msg);
                    }
                    if (parameters[i] != null)
                    {
                        msg = msg + parameters[i].GetType().FullName;
                    }
                    else
                    {
                        msg = msg + "null";
                    }
                }

                msg = string.Format("{0}) for class {1}", msg, c);

                rlog.Error(msg);
            }

            return(null);
        }
Example #2
0
 /// <seealso cref="org.apache.velocity.runtime.Log.LogMessage.Error(java.lang.Object)">
 /// </seealso>
 public override void Error(System.Object message)
 {
     rlog.Error(message);
 }