net.janino
Class IClassLoader

java.lang.Object
  |
  +--net.janino.IClassLoader
Direct Known Subclasses:
ClassLoaderIClassLoader

public class IClassLoader
extends java.lang.Object

Loads an IClass by type name.


Field Summary
 IClass BOOLEAN
           
 IClass BYTE
           
 IClass CHAR
           
 IClass CLASS
           
 IClass CLONEABLE
           
 IClass DOUBLE
           
 IClass ERROR
           
 IClass FLOAT
           
 IClass INT
           
 IClass LONG
           
 IClass OBJECT
           
 IClass RUNTIME_EXCEPTION
           
 IClass SERIALIZABLE
           
 IClass SHORT
           
 IClass STRING
           
 IClass THROWABLE
           
 IClass VOID
           
 
Constructor Summary
IClassLoader()
           
 
Method Summary
protected  void defineIClass(IClass iClass)
          Define an IClass in the context of this IClassLoader.
protected  IClass findIClass(java.lang.String type)
          Find a new IClass by descriptor.
 IClass getLoadedIClass(java.lang.String typeFD)
          Similar to loadIClass(String), but does not attempt to find the IClass if it is not yet loaded.
 IClass loadArrayIClass(IClass componentType)
          Returns the type of an array of the class, interface, array or primitive.
Returns "null" for "void".
 IClass loadIClass(java.lang.String type)
          Get IClass by descriptor.
protected  void postConstruct()
          This method must be called by the constructor of the directly derived class.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VOID

public IClass VOID

BYTE

public IClass BYTE

CHAR

public IClass CHAR

DOUBLE

public IClass DOUBLE

FLOAT

public IClass FLOAT

INT

public IClass INT

LONG

public IClass LONG

SHORT

public IClass SHORT

BOOLEAN

public IClass BOOLEAN

OBJECT

public IClass OBJECT

STRING

public IClass STRING

CLASS

public IClass CLASS

THROWABLE

public IClass THROWABLE

RUNTIME_EXCEPTION

public IClass RUNTIME_EXCEPTION

ERROR

public IClass ERROR

CLONEABLE

public IClass CLONEABLE

SERIALIZABLE

public IClass SERIALIZABLE
Constructor Detail

IClassLoader

public IClassLoader()
Method Detail

postConstruct

protected final void postConstruct()
                            throws java.lang.ClassNotFoundException
This method must be called by the constructor of the directly derived class. (The reason being is that this method invokes abstract loadIClass(String) which will not work until the implementing class is constructed.)
Throws:
java.lang.ClassNotFoundException -  

loadIClass

public final IClass loadIClass(java.lang.String type)
                        throws java.lang.ClassNotFoundException
Get IClass by descriptor.
Parameters:
type - the descriptor of the class or interface to load
Returns:
the loaded IClass
Throws:
java.lang.ClassNotFoundException - if the {@IClass} could not be loaded

getLoadedIClass

public IClass getLoadedIClass(java.lang.String typeFD)
Similar to loadIClass(String), but does not attempt to find the IClass if it is not yet loaded.
Parameters:
type - the descriptor of the class or interface to look for
Returns:
the loaded IClass or null if not loaded

loadArrayIClass

public final IClass loadArrayIClass(IClass componentType)
Returns the type of an array of the class, interface, array or primitive.
Returns "null" for "void".

findIClass

protected IClass findIClass(java.lang.String type)
                     throws java.lang.ClassNotFoundException
Find a new IClass by descriptor. The default implementation throws a ClassNotFoundException. This method is typically overridden by the derived class.

Like java.lang.reflect.ClassLoader.findClass(String), this method must

The format of a descriptor is defined in JVMS 4.3.2. Typical descriptors are:


defineIClass

protected void defineIClass(IClass iClass)
Define an IClass in the context of this IClassLoader. If an IClass with that descriptor already exists, a java.lang.RuntimeException is thrown.
Throws:
java.lang.RuntimeException - A different IClass object is already defined for this type