loadClass() private method

private loadClass ( global par0 ) : global::java.lang.Class
par0 global
return global::java.lang.Class
        private static Class LoadClass(string name, ClassLoader classLoader, JNIEnv env)
        {
            Class res = null;
            if (classLoader == null)
            {
                classLoader = systemClassLoader;
                string rn = name.Replace('.', '/');
                res = env.FindClassNoThrow(rn);
            }
            if (classLoader != null && res==null)
            {
                try
                {
                    res = classLoader.loadClass(name);
                }
                catch (Throwable th)
                {
                    throw new JNIException("Can't load java class for " + name + " from classLoader " + classLoader, th);
                }
            }

            return res;
        }
示例#2
0
		/// <summary>
		/// Perform instantiation of the process's
		/// <see cref="Application">Application</see>
		/// object.  The
		/// default implementation provides the normal system behavior.
		/// </summary>
		/// <param name="cl">The ClassLoader with which to instantiate the object.</param>
		/// <param name="className">
		/// The name of the class implementing the Application
		/// object.
		/// </param>
		/// <param name="context">The context to initialize the application with</param>
		/// <returns>The newly instantiated Application object.</returns>
		/// <exception cref="java.lang.InstantiationException"></exception>
		/// <exception cref="System.MemberAccessException"></exception>
		/// <exception cref="System.TypeLoadException"></exception>
		public virtual Application newApplication (ClassLoader cl, string klass, Context context)
		{
			return newApplication (cl.loadClass (klass), context);
		}