|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface MethodStrategy
A strategy for modifying a method. The difference between this and a MethodAdapter is that a MethodStrategy has access to the ClassVisitor and therefore can create additional methods if needed, for example to rename a method and create a wrapper.
MethodStrategy instances are kept in statically initialized tables and reused. Implementations should not contain any mutable state.
Method Summary | |
---|---|
MethodVisitor |
visitMethod(ClassVisitor cv,
java.lang.String ownerType,
java.lang.String outerType,
java.lang.String outerDesc,
int access,
java.lang.String name,
java.lang.String desc,
java.lang.String signature,
java.lang.String[] exceptions)
Instrument a method, possibly creating other methods in the process. |
Method Detail |
---|
MethodVisitor visitMethod(ClassVisitor cv, java.lang.String ownerType, java.lang.String outerType, java.lang.String outerDesc, int access, java.lang.String name, java.lang.String desc, java.lang.String signature, java.lang.String[] exceptions)
visitMethod(...) { return cv.visitMethod(access, name, desc, signature, exceptions); }This would delegate the visitMethod() call to the next class adapter in the chain, returning a method visitor which could then be visited with the method's contents.
cv
- a way of calling the next class adapter in the chain. Do not pass in the samed ClassVisitor that
is invoking the method strategy, or you'll recurse endlessly! Note that cv.visitMethod may be called more
than once during a single call to this method, and must return a distinct MethodVisitor instance for each
call.ownerType
- the internal type name of the class that contains the method, e.g., "org/xyz/Foo$Bar"outerType
- null if ownerType is a top-level type, or else the internal type name of its outer class e.g.
"org/xyz/Foo"outerDesc
- null if ownerType is a top-level type, or else the type descriptor of its outer class, e.g.
"Lorg/xyz/Foo;"
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |