public final class

ClassFinder

extends Object
java.lang.Object
   ↳ com.sun.beans.finder.ClassFinder

Class Overview

This is utility class that provides static methods to find a class with the specified name using the specified class loader.

Summary

Public Methods
static Class findClass(String name)
Returns the Class object associated with the class or interface with the given string name, using the default class loader.
static Class findClass(String name, ClassLoader loader)
Returns the Class object associated with the class or interface with the given string name, using the given class loader.
static Class resolveClass(String name, ClassLoader loader)
Returns the Class object associated with the class or interface with the given string name, using the given class loader.
static Class resolveClass(String name)
Returns the Class object associated with the class or interface with the given string name, using the default class loader.
[Expand]
Inherited Methods
From class java.lang.Object

Public Methods

public static Class findClass (String name)

Returns the Class object associated with the class or interface with the given string name, using the default class loader.

The name can denote an array class (see getName() for details).

Parameters
name fully qualified name of the desired class
Returns
  • class object representing the desired class
Throws
ClassNotFoundException if the class cannot be located by the specified class loader

public static Class findClass (String name, ClassLoader loader)

Returns the Class object associated with the class or interface with the given string name, using the given class loader.

The name can denote an array class (see getName() for details).

If the parameter loader is null, the class is loaded through the default class loader.

Parameters
name fully qualified name of the desired class
loader class loader from which the class must be loaded
Returns
  • class object representing the desired class
Throws
ClassNotFoundException if the class cannot be located by the specified class loader

public static Class resolveClass (String name, ClassLoader loader)

Returns the Class object associated with the class or interface with the given string name, using the given class loader.

The name can denote an array class (see getName() for details).

If the parameter loader is null, the class is loaded through the default class loader.

This method can be used to obtain any of the Class objects representing void or primitive Java types: char, byte, short, int, long, float, double and boolean.

Parameters
name fully qualified name of the desired class
loader class loader from which the class must be loaded
Returns
  • class object representing the desired class
Throws
ClassNotFoundException if the class cannot be located by the specified class loader
See Also

public static Class resolveClass (String name)

Returns the Class object associated with the class or interface with the given string name, using the default class loader.

The name can denote an array class (see getName() for details).

This method can be used to obtain any of the Class objects representing void or primitive Java types: char, byte, short, int, long, float, double and boolean.

Parameters
name fully qualified name of the desired class
Returns
  • class object representing the desired class
Throws
ClassNotFoundException if the class cannot be located by the specified class loader