Java Class Load loadClass(String h, String prefix)

Here you can find the source of loadClass(String h, String prefix)

Description

Load a named class.

License

Open Source License

Declaration

public static Class loadClass(String h, String prefix) 

Method Source Code

//package com.java2s;
/*****************************************************************************
 * The contents of this file are subject to the Ricoh Source Code Public
 * License Version 1.0 (the "License"); you may not use this file except in
 * compliance with the License.  You may obtain a copy of the License at
 * http://www.risource.org/RPL/*ww w . j a  v  a  2 s. com*/
 *
 * Software distributed under the License is distributed on an "AS IS" basis,
 * WITHOUT WARRANTY OF ANY KIND, either express or implied.  See the License
 * for the specific language governing rights and limitations under the
 * License.
 *
 * This code was initially developed by Ricoh Innovations, Inc.  Portions
 * created by Ricoh Innovations, Inc. are Copyright (C) 1995-1999.  All
 * Rights Reserved.
 *
 * Contributor(s):
 *
 ***************************************************************************** 
*/

public class Main {
    /** Load a named class.  The <code>packagePrefix</code> is prepended only if
     *   the handle name contains no "." characters, and should end with a "." 
     *   in most cases.  Util.javaName can be used to convert an SGML 
     *   identifier (e.g. a tag) to a class name.
     *
     * @see Util#javaName
     */
    public static Class loadClass(String h, String prefix) {
        if (h.indexOf(".") < 0)
            h = prefix + h;
        try {
            Class handleClass = Class.forName(h);
            return handleClass;
        } catch (Exception e) {
        }
        return null;
    }
}

Related

  1. loadClass(String className, ClassLoader classLoader)
  2. loadClass(String className, ClassLoader classLoader)
  3. loadClass(String className, ClassLoader classLoader)
  4. loadClass(String clazz, ClassLoader cl)
  5. loadClass(String fqcn, Class... classes)
  6. loadClass(String inClassName)
  7. loadClass(String name)
  8. loadClass(String name)
  9. loadClass(String name)