|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Translator
An observer of ClassPool
.
The users can define a class implementing this
interface and attach an instance of that class to a
ClassPool
object so that it can translate a class file
when the class file is loaded into the JVM, for example.
ClassPool.ClassPool(ClassPool,Translator)
,
ClassPool.getDefault(Translator)
Method Summary | |
---|---|
void |
onWrite(ClassPool pool,
java.lang.String classname)
Is invoked by a ClassPool for notifying that
a class is written out to an output stream. |
void |
start(ClassPool pool)
Is invoked by a ClassPool for initialization
when the object is attached to a ClassPool object. |
Method Detail |
---|
void start(ClassPool pool) throws NotFoundException, CannotCompileException
ClassPool
for initialization
when the object is attached to a ClassPool
object.
pool
- the ClassPool
that this translator
is attached to.
NotFoundException
CannotCompileException
ClassPool.ClassPool(ClassPool,Translator)
,
ClassPool.getDefault(Translator)
void onWrite(ClassPool pool, java.lang.String classname) throws NotFoundException, CannotCompileException
ClassPool
for notifying that
a class is written out to an output stream.
If CtClass.frozen() is true, that is, if the class has been already modified and written, then onWrite() is not invoked.
pool
- the ClassPool
that this translator
is attached to.classname
- a fully-qualified class name
NotFoundException
CannotCompileException
ClassPool.writeFile(String)
,
ClassPool.writeFile(String, String)
,
ClassPool.write(String)
,
ClassPool.write(String,DataOutputStream)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |