Web Site

org.codehaus.janino
Class IClassLoader

java.lang.Object
  extended by org.codehaus.janino.IClassLoader
Direct Known Subclasses:
ClassLoaderIClassLoader, JavaSourceIClassLoader, ResourceFinderIClassLoader

public abstract class IClassLoader
extends java.lang.Object

Loads an IClass by type name.


Field Summary
 IClass BOOLEAN
           
 IClass BYTE
           
 IClass CHARACTER
           
 IClass CLASS
           
 IClass CLONEABLE
           
 IClass DOUBLE
           
 IClass ERROR
           
 IClass FLOAT
           
 IClass INTEGER
           
 IClass LONG
           
 IClass OBJECT
           
 IClass RUNTIME_EXCEPTION
           
 IClass SERIALIZABLE
           
 IClass SHORT
           
 IClass STRING
           
 IClass THROWABLE
           
 
Constructor Summary
IClassLoader(IClassLoader optionalParentIClassLoader)
           
 
Method Summary
protected  void defineIClass(IClass iClass)
          Define an IClass in the context of this IClassLoader.
protected abstract  IClass findIClass(java.lang.String descriptor)
          Find a new IClass by descriptor; return null if a class for that descriptor could not be found.
 IClass loadIClass(java.lang.String fieldDescriptor)
          Get an IClass by field 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

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

BOOLEAN

public IClass BOOLEAN

BYTE

public IClass BYTE

CHARACTER

public IClass CHARACTER

SHORT

public IClass SHORT

INTEGER

public IClass INTEGER

LONG

public IClass LONG

FLOAT

public IClass FLOAT

DOUBLE

public IClass DOUBLE
Constructor Detail

IClassLoader

public IClassLoader(IClassLoader optionalParentIClassLoader)
Method Detail

postConstruct

protected final void postConstruct()
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.)


loadIClass

public final IClass loadIClass(java.lang.String fieldDescriptor)
                        throws java.lang.ClassNotFoundException
Get an IClass by field descriptor.

Returns:
null if an IClass could not be loaded
Throws:
{@link - ClassNotFoundException} if an exception was raised while loading the IClass
java.lang.ClassNotFoundException

findIClass

protected abstract IClass findIClass(java.lang.String descriptor)
                              throws java.lang.ClassNotFoundException
Find a new IClass by descriptor; return null if a class for that descriptor could not be found.

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

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

Notice that this method is never called for array types.

Notice that this method is never called from more than one thread at a time. In other words, implementations of this method need not be synchronized.

Returns:
null if a class with that descriptor could not be found
Throws:
java.lang.ClassNotFoundException - if an exception was raised while loading the class

defineIClass

protected final void defineIClass(IClass iClass)
Define an IClass in the context of this IClassLoader. If an IClass with that descriptor already exists, a RuntimeException is thrown.

This method should only be called from an implementation of findIClass(String).

Throws:
java.lang.RuntimeException - A different IClass object is already defined for this type

Web Site