org.jacoco.core.instr
Class ClassAnalyzer
java.lang.Object
org.jacoco.core.instr.BlockClassAdapter
org.jacoco.core.instr.ClassAnalyzer
- All Implemented Interfaces:
- ClassVisitor
public class ClassAnalyzer
- extends BlockClassAdapter
A ClassVisitor
that analyzes the structure of a class.
- Version:
- $Revision: $
- Author:
- Marc R. Hoffmann
Method Summary |
void |
visit(int version,
int access,
String name,
String signature,
String superName,
String[] interfaces)
|
protected MethodVisitor |
visitAbstractMethod(int access,
String name,
String desc,
String signature,
String[] exceptions)
This method is called for every abstract method. |
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)
|
protected IBlockMethodVisitor |
visitNonAbstractMethod(int access,
String name,
String desc,
String signature,
String[] exceptions)
This method is called for every non-abstract method. |
void |
visitOuterClass(String owner,
String name,
String desc)
|
void |
visitSource(String source,
String debug)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ClassAnalyzer
public ClassAnalyzer(IClassStructureVisitor structureVisitor)
- Creates a new analyzer that reports to the given
IClassStructureVisitor
instance.
- Parameters:
structureVisitor
- consumer for class structure output
visit
public void visit(int version,
int access,
String name,
String signature,
String superName,
String[] interfaces)
visitSource
public void visitSource(String source,
String debug)
visitNonAbstractMethod
protected IBlockMethodVisitor visitNonAbstractMethod(int access,
String name,
String desc,
String signature,
String[] exceptions)
- Description copied from class:
BlockClassAdapter
- This method is called for every non-abstract method.
- Specified by:
visitNonAbstractMethod
in class BlockClassAdapter
- Parameters:
access
- the method's access flags (see Opcodes
). This
parameter also indicates if the method is synthetic and/or
deprecated.name
- the method's name.desc
- the method's descriptor (see Type
).signature
- the method's signature. May be null if the method
parameters, return type and exceptions do not use generic
types.exceptions
- the internal names of the method's exception classes (see
getInternalName
). May be
null.
- Returns:
- an object to visit the byte code of the method, or null
if this class visitor is not interested in visiting the code of
this method.
visitAbstractMethod
protected MethodVisitor visitAbstractMethod(int access,
String name,
String desc,
String signature,
String[] exceptions)
- Description copied from class:
BlockClassAdapter
- This method is called for every abstract method.
- Specified by:
visitAbstractMethod
in class BlockClassAdapter
- Parameters:
access
- the method's access flags (see Opcodes
). This
parameter also indicates if the method is synthetic and/or
deprecated.name
- the method's name.desc
- the method's descriptor (see Type
).signature
- the method's signature. May be null if the method
parameters, return type and exceptions do not use generic
types.exceptions
- the internal names of the method's exception classes (see
getInternalName
). May be
null.
- Returns:
- an object to visit the byte code of the method, or null
if this class visitor is not interested in visiting the code of
this method.
visitEnd
public void visitEnd()
visitAnnotation
public AnnotationVisitor visitAnnotation(String desc,
boolean visible)
visitField
public FieldVisitor visitField(int access,
String name,
String desc,
String signature,
Object value)
visitInnerClass
public void visitInnerClass(String name,
String outerName,
String innerName,
int access)
visitOuterClass
public void visitOuterClass(String owner,
String name,
String desc)
visitAttribute
public void visitAttribute(Attribute attr)