|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--net.janino.IClassLoader
Loads an IClass
by type name.
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 |
public IClass VOID
public IClass BYTE
public IClass CHAR
public IClass DOUBLE
public IClass FLOAT
public IClass INT
public IClass LONG
public IClass SHORT
public IClass BOOLEAN
public IClass OBJECT
public IClass STRING
public IClass CLASS
public IClass THROWABLE
public IClass RUNTIME_EXCEPTION
public IClass ERROR
public IClass CLONEABLE
public IClass SERIALIZABLE
Constructor Detail |
public IClassLoader()
Method Detail |
protected final void postConstruct() throws java.lang.ClassNotFoundException
loadIClass(String)
which will not work until the implementing
class is constructed.)java.lang.ClassNotFoundException
- public final IClass loadIClass(java.lang.String type) throws java.lang.ClassNotFoundException
IClass
by descriptor.type
- the descriptor of the class or interface to loadIClass
java.lang.ClassNotFoundException
- if the {@IClass} could not be loadedpublic IClass getLoadedIClass(java.lang.String typeFD)
loadIClass(String)
, but does not attempt to find the IClass
if it is not yet loaded.type
- the descriptor of the class or interface to look forIClass
or null
if not loadedpublic final IClass loadArrayIClass(IClass componentType)
protected IClass findIClass(java.lang.String type) throws java.lang.ClassNotFoundException
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
IClass
object from somewhere for the given type
defineIClass(IClass)
with thatIClass
object as
the argument
IClass
object
The format of a descriptor is defined in JVMS 4.3.2. Typical descriptors are:
I
(Integer)
[[I
(Array of array of integer)
Lpkg1/pkg2/Cls;
(Class declared in package)
[Lpkg1/pkg2/Cls;
(Array of class)
Lpkg1/pkg2/Outer$Inner;
Member class
protected void defineIClass(IClass iClass)
IClass
in the context of this IClassLoader
.
If an IClass
with that descriptor already exists, a
java.lang.RuntimeException
is thrown.java.lang.RuntimeException
- A different IClass
object is already defined for this type
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |