net.sourceforge.groboutils.codecoverage.v2
Interface IMethodCode

All Known Implementing Classes:
DefaultMethodCode

public interface IMethodCode

Contains the BCEL bytecode for a method, and provides helper methods for generating the marks for certain bytecode instructions.

Since:
December 15, 2002
Version:
$Date: 2003/02/10 22:51:25 $
Author:
Matt Albrecht groboclown@users.sourceforge.net

Method Summary
 java.lang.String getClassName()
          A helper to get the class name.
 org.apache.bcel.generic.Instruction getInstructionAt(int index)
          Returns the bytecode instruction at the given index.
 int getInstructionCount()
          Returns the number of bytecode instructions in the method.
 java.lang.String getMethodName()
          A helper to get the method name.
 org.apache.bcel.classfile.Method getOriginalMethod()
          Returns the original BCEL Method object.
 void markInstruction(int index, IAnalysisMetaData meta)
          Marks an instruction for coverage analysis.
 

Method Detail

getOriginalMethod

public org.apache.bcel.classfile.Method getOriginalMethod()
Returns the original BCEL Method object.

Returns:
the original BCEL Method object

getMethodName

public java.lang.String getMethodName()
A helper to get the method name.

Returns:
the method name

getClassName

public java.lang.String getClassName()
A helper to get the class name.

Returns:
the class name

getInstructionCount

public int getInstructionCount()
Returns the number of bytecode instructions in the method.

Returns:
the number of bytecode instructions

getInstructionAt

public org.apache.bcel.generic.Instruction getInstructionAt(int index)
Returns the bytecode instruction at the given index. If the index is out of range (< 0 or >= getInstructionCount()), then a IndexOutOfBoundsException is thrown.

Parameters:
index - the 0-based index of the method's instruction list
Returns:
the instruction at index

markInstruction

public void markInstruction(int index,
                            IAnalysisMetaData meta)
Marks an instruction for coverage analysis. If the index is out of range (< 0 or >= getInstructionCount()), then a IndexOutOfBoundsException is thrown.

Parameters:
index - the 0-based index of the method's instruction list
meta - meta-data the analysis module records in association with the mark. This cannot be null.
Throws:
java.lang.IllegalArgumentException - if meta is null.
java.lang.IndexOutOfBoundsException - if index is not within the valid range.


Copyright © 2001-2003 by The GroboUtils Project