Overview | Package | Class | Use | Tree | Deprecated | Index
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## javassist
Interface Translator

All Known Implementing Classes:
  Reflection, StubGenerator

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.

See Also:
  `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

### start

    public void start(ClassPool pool)
               throws NotFoundException,
                      CannotCompileException

  Is invoked by a `ClassPool` for initialization when the object is attached to a `ClassPool` object.

  Parameters:
    `pool` - the `ClassPool` that this translator is attached to.
    `NotFoundException`
    `CannotCompileException`
  See Also:
    `ClassPool.ClassPool(ClassPool,Translator)`, `ClassPool.getDefault(Translator)`

### onWrite

    public void onWrite(ClassPool pool,
                        java.lang.String classname)
                 throws NotFoundException,
                        CannotCompileException

  Is invoked by a `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.

  Parameters:
    `pool` - the `ClassPool` that this translator is attached to.
    `classname` - a fully-qualified class name
    `NotFoundException`
    `CannotCompileException`
  See Also:
    `ClassPool.writeFile(String)`, `ClassPool.writeFile(String, String)`, `ClassPool.write(String)`, `ClassPool.write(String,DataOutputStream)`

Overview | Package | Class | Use | Tree | Deprecated | Index
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Javassist, a Java-bytecode translator toolkit. Copyright (C) 1999-2003 Shigeru Chiba. All Rights Reserved.