org.objectweb.asm.tree
public class TreeClassAdapter extends ClassAdapter
ClassAdapter that constructs a tree representation of
the classes it vists. Each visitXXX method of this class
constructs an XXXNode and adds it to the classNode node (except the visitEnd method, which just
makes the cv class visitor visit the tree that has just been
constructed).
In order to implement a usefull class adapter based on a tree representation
of classes, one just need to override the visitEnd method
with a method of the following form:
public void visitEnd () {
// ...
// code to modify the classNode tree, can be arbitrary complex
// ...
// makes the cv visitor visit this modified class:
classNode.accept(cv);
}
| Field Summary | |
|---|---|
| ClassNode | classNode
A tree representation of the class that is being visited by this visitor. |
| Constructor Summary | |
|---|---|
| TreeClassAdapter(ClassVisitor cv)
Constructs a new TreeClassAdapter object.
| |
| Method Summary | |
|---|---|
| void | visit(int version, int access, String name, String superName, String[] interfaces, String sourceFile) |
| void | visitAttribute(Attribute attr) |
| void | visitEnd() |
| void | visitField(int access, String name, String desc, Object value, Attribute attrs) |
| void | visitInnerClass(String name, String outerName, String innerName, int access) |
| CodeVisitor | visitMethod(int access, String name, String desc, String[] exceptions, Attribute attrs) |
TreeClassAdapter object.
Parameters: cv the class visitor to which this adapter must delegate calls.