org.objectweb.asm.tree
Class TreeClassAdapter
- ClassVisitor
public class TreeClassAdapter
A
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);
}
ClassNode | classNode - A tree representation of the class that is being visited by this visitor.
|
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)
|
classNode
public ClassNode classNode
A tree representation of the class that is being visited by this visitor.
TreeClassAdapter
public TreeClassAdapter(ClassVisitor cv)
cv
- the class visitor to which this adapter must delegate calls.
visit
public void visit(int version,
int access,
String name,
String superName,
String[] interfaces,
String sourceFile)
- visit in interface ClassVisitor
- visit in interface ClassAdapter