net.groboclown.util.jplugin.v2
Class BaseClassInspector

java.lang.Object
  |
  +--net.groboclown.util.jplugin.v2.BaseClassInspector
All Implemented Interfaces:
IClassInspector
Direct Known Subclasses:
URLClassInspector

public abstract class BaseClassInspector
extends Object
implements IClassInspector

Extracts the class instance based on the class name. The ClassLoader must be specified during construction time, or before any classes are loaded.

Version:
0.9.0 Alpha
Author:
Matt Albrecht

Field Summary
private  ClassLoader cloader
           
 
Constructor Summary
BaseClassInspector()
          Default constructor
 
Method Summary
 Class getClass(String className)
          Retrieve the class object associated with the given name, or null if it cannot be found.
 Object instantiate(String className)
          Create an instance of the given class name, or return null if the class could not be found, or if the class does not have a default constructor.
protected  void setClassLoader(ClassLoader cl)
           
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

cloader

private ClassLoader cloader
Constructor Detail

BaseClassInspector

public BaseClassInspector()
Default constructor
Method Detail

getClass

public Class getClass(String className)
               throws NoClassDefFoundError
Retrieve the class object associated with the given name, or null if it cannot be found.
Specified by:
getClass in interface IClassInspector
Throws:
NoClassDefFoundError - thrown if the class either is abstract, an interface, non-public, or depends upon other classes that are not available.

instantiate

public Object instantiate(String className)
Create an instance of the given class name, or return null if the class could not be found, or if the class does not have a default constructor.

Provided because an inspector may have a unique way to create the class object (if, say, the default constructor isn't used).

Specified by:
instantiate in interface IClassInspector

setClassLoader

protected void setClassLoader(ClassLoader cl)


Written under the LGPL