org.objectweb.asm.util
Class CheckClassAdapter
- ClassVisitor
public class CheckClassAdapter
A
ClassAdapter
that checks that its methods are properly used. More
precisely this class adapter checks each method call individually, based
only on its arguments, but does
not check the
sequence
of method calls. For example, the invalid sequence
visitField(ACC_PUBLIC, "i", "I", null) visitField(ACC_PUBLIC,
"i", "D", null)
will
not be detected by this class adapter.
static void | main(String[] args) - Checks a given class.
|
static void | verify(ClassReader cr, boolean dump, PrintWriter pw) - Checks a given class
|
void | visit(int version, int access, String name, String signature, String superName, String[] interfaces)
|
AnnotationVisitor | visitAnnotation(String desc, boolean visible)
|
void | visitAttribute(Attribute attr)
|
void | visitEnd()
|
FieldVisitor | visitField(int access, String name, String desc, String signature, Object value)
|
void | visitInnerClass(String name, String outerName, String innerName, int access)
|
MethodVisitor | visitMethod(int access, String name, String desc, String signature, String[] exceptions)
|
void | visitOuterClass(String owner, String name, String desc)
|
void | visitSource(String file, String debug)
|
CheckClassAdapter
public CheckClassAdapter(ClassVisitor cv)
cv
- the class visitor to which this adapter must delegate calls.
main
public static void main(String[] args)
throws Exception
Checks a given class.
Usage: CheckClassAdapter <fully qualified
class name or class file name>
args
- the command line arguments.
verify
public static void verify(ClassReader cr,
boolean dump,
PrintWriter pw)
Checks a given class
cr
- a ClassReader
that contains bytecode for the analysis.dump
- true if bytecode should be printed out not only when errors are found.pw
- write where results going to be printed
visit
public void visit(int version,
int access,
String name,
String signature,
String superName,
String[] interfaces)
- visit in interface ClassVisitor
- visit in interface ClassAdapter