|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javassist.ClassPool org.ocltf.translation.TraceTranslator.TranslatorClassPool
Extends the Javaassist class pool so that we can define our own ClassLoader to use from which to find, load and modify and existing class.
Field Summary |
Fields inherited from class javassist.ClassPool |
classes, source, translator |
Constructor Summary | |
protected |
TraceTranslator.TranslatorClassPool()
|
Method Summary | |
protected static javassist.ClassPool |
getPool(java.lang.ClassLoader loader)
Retrieves an instance of this TranslatorClassPool using the loader to find/load any classes. |
java.lang.Class |
writeAsClass(java.lang.String classname)
Returns a java.lang.Class object. |
Methods inherited from class javassist.ClassPool |
appendClassPath, appendClassPath, appendPathList, appendSystemPath, debugWriteFile, debugWriteFile, forName, get, get, get0, getAndRename, getCached, getDefault, getDefault, getMethod, getTranslator, insertClassPath, insertClassPath, lookupCflow, makeClass, makeClass, makeClass, makeInterface, makeInterface, removeCached, removeClassPath, toString, write, write, writeFile, writeFile |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
protected TraceTranslator.TranslatorClassPool()
Method Detail |
protected static javassist.ClassPool getPool(java.lang.ClassLoader loader)
loader
-
public java.lang.Class writeAsClass(java.lang.String classname) throws javassist.NotFoundException, java.io.IOException, javassist.CannotCompileException
java.lang.Class
object.
It calls write()
to obtain a class file and then
loads the obtained class file into the JVM. The returned
Class
object represents the loaded class.
To load a class file, this method uses an internal class loader.
Thus, that class file is not loaded by the system class loader,
which should have loaded this AspectClassPool
class.
The internal class loader
loads only the classes explicitly specified by this method
writeAsClass()
. The other classes are loaded
by the parent class loader (the sytem class loader) by delegation.
Thus, if a class X
loaded by the internal class
loader refers to a class Y
, then the class
Y
is loaded by the parent class loader.
classname
- a fully-qualified class name.
javassist.NotFoundException
java.io.IOException
javassist.CannotCompileException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |