|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.objectweb.asm.MethodAdapter
com.ikokoon.serenity.instrumentation.complexity.ComplexityMethodAdapter
public class ComplexityMethodAdapter
TODO - add the interesting methods to the collection of the complexity. Do we need to add try catch? And what about multiple catch? One for each potential exception thrown? No? This class just visits the byte code in the classes and collects the complexity metrics for the class. Complexity is calculated by adding one every time there is a jump instruction.
| Field Summary |
|---|
| Fields inherited from class org.objectweb.asm.MethodAdapter |
|---|
mv |
| Constructor Summary | |
|---|---|
ComplexityMethodAdapter(org.objectweb.asm.MethodVisitor methodVisitor,
java.lang.Integer access,
java.lang.String className,
java.lang.String methodName,
java.lang.String methodDescription)
The constructor initialises a ComplexityMethodAdapter that takes all the interesting items for the method that is to be enhanced
including the parent method visitor. |
|
| Method Summary | |
|---|---|
void |
visitEnd()
|
void |
visitInsn(int opcode)
|
void |
visitJumpInsn(int opcode,
org.objectweb.asm.Label paramLabel)
|
void |
visitLineNumber(int lineNumber,
org.objectweb.asm.Label label)
|
void |
visitLookupSwitchInsn(org.objectweb.asm.Label dflt,
int[] keys,
org.objectweb.asm.Label[] labels)
|
void |
visitTableSwitchInsn(int min,
int max,
org.objectweb.asm.Label dflt,
org.objectweb.asm.Label[] labels)
|
void |
visitTryCatchBlock(org.objectweb.asm.Label start,
org.objectweb.asm.Label end,
org.objectweb.asm.Label handler,
java.lang.String type)
|
| Methods inherited from class org.objectweb.asm.MethodAdapter |
|---|
visitAnnotation, visitAnnotationDefault, visitAttribute, visitCode, visitFieldInsn, visitIincInsn, visitIntInsn, visitLabel, visitLdcInsn, visitLocalVariable, visitMaxs, visitMethodInsn, visitMultiANewArrayInsn, visitParameterAnnotation, visitTypeInsn, visitVarInsn |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ComplexityMethodAdapter(org.objectweb.asm.MethodVisitor methodVisitor,
java.lang.Integer access,
java.lang.String className,
java.lang.String methodName,
java.lang.String methodDescription)
ComplexityMethodAdapter that takes all the interesting items for the method that is to be enhanced
including the parent method visitor.
methodVisitor - the method visitor of the parentclassName - the name of the class the method belongs tomethodName - the name of the method that will be collected for complexitymethodDescription - the description of the method, i.e. the byte code signature| Method Detail |
|---|
public void visitLineNumber(int lineNumber,
org.objectweb.asm.Label label)
visitLineNumber in interface org.objectweb.asm.MethodVisitorvisitLineNumber in class org.objectweb.asm.MethodAdapter
public void visitJumpInsn(int opcode,
org.objectweb.asm.Label paramLabel)
visitJumpInsn in interface org.objectweb.asm.MethodVisitorvisitJumpInsn in class org.objectweb.asm.MethodAdapterpublic void visitEnd()
visitEnd in interface org.objectweb.asm.MethodVisitorvisitEnd in class org.objectweb.asm.MethodAdapter
public void visitTryCatchBlock(org.objectweb.asm.Label start,
org.objectweb.asm.Label end,
org.objectweb.asm.Label handler,
java.lang.String type)
visitTryCatchBlock in interface org.objectweb.asm.MethodVisitorvisitTryCatchBlock in class org.objectweb.asm.MethodAdapter
public void visitLookupSwitchInsn(org.objectweb.asm.Label dflt,
int[] keys,
org.objectweb.asm.Label[] labels)
visitLookupSwitchInsn in interface org.objectweb.asm.MethodVisitorvisitLookupSwitchInsn in class org.objectweb.asm.MethodAdapter
public void visitTableSwitchInsn(int min,
int max,
org.objectweb.asm.Label dflt,
org.objectweb.asm.Label[] labels)
visitTableSwitchInsn in interface org.objectweb.asm.MethodVisitorvisitTableSwitchInsn in class org.objectweb.asm.MethodAdapterpublic void visitInsn(int opcode)
visitInsn in interface org.objectweb.asm.MethodVisitorvisitInsn in class org.objectweb.asm.MethodAdapter
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||