| java.lang.Object csdl.jblanket.modifier.MethodModifier
MethodModifier | public class MethodModifier (Code) | | Provides a Modifier for methods in .class files. Methods are either instrumented or recorded
for exclusion from coverage. Modifying a method here is performed unconditionally. Therefore,
without first checking at the ClassModifier level to see if a class as a whole has been
previously modified can result in numerous modifications to a method.
Recording a method for exclusion from coverage leaves its byte code unchanged.
author: Joy M. Agustin version: $Id: MethodModifier.java,v 1.5 2005/03/08 08:02:01 timshadel Exp $ |
Constructor Summary | |
public | MethodModifier(boolean verbose, String testGrammar, boolean excludeOneLineMethods, boolean excludeIndividualMethods, boolean excludeConstructors, MethodGen method) Constructs a new MethodModifier object. |
Method Summary | |
public void | excludeMethod(MethodSet excludeSet) Records this method to exclude from coverage and stores it in excludeSet . | public boolean | hasLineNumbers() Checks if a method contains line numbers. | public boolean | isConstructor() Checks if method is a constructor. | public boolean | isOneLine() Checks if method contains one line of source code. | public Method | processMethod(ConstantPoolGen pool, boolean isModified) Processes a method. |
MethodModifier | public MethodModifier(boolean verbose, String testGrammar, boolean excludeOneLineMethods, boolean excludeIndividualMethods, boolean excludeConstructors, MethodGen method)(Code) | | Constructs a new MethodModifier object.
Parameters: verbose - describes if JBlanket should execute in verbose mode. Parameters: testGrammar - the grammar describing test class names. Parameters: excludeOneLineMethods - describes exclusion of one-line methods. Parameters: excludeIndividualMethods - describes exclusion of individual methods. Parameters: excludeConstructors - describes exclusion of constructors. Parameters: method - the method to modify. |
excludeMethod | public void excludeMethod(MethodSet excludeSet)(Code) | | Records this method to exclude from coverage and stores it in excludeSet .
Parameters: excludeSet - the container storing methods to exclude from coverage. |
hasLineNumbers | public boolean hasLineNumbers()(Code) | | Checks if a method contains line numbers. If so, then it is valid. If not, then the method
is invalid. Line numbers are added by enabling debugging when compiling.
true if method contains line numbers, false otherwise. |
isConstructor | public boolean isConstructor()(Code) | | Checks if method is a constructor. It does not matter if it's implemented by
the programmer or automatically generated by the compiler. If it is a constructor,
method is stored. Valid constructor method name is <init>.
true if method is a constructor, false otherwise. |
isOneLine | public boolean isOneLine()(Code) | | Checks if method contains one line of source code. If so, method
is stored.
true if method contains one line, false otherwise. |
processMethod | public Method processMethod(ConstantPoolGen pool, boolean isModified)(Code) | | Processes a method. The method represented by this MethodModifier is not modified if it is
abstract or native. Furthermore, it is not modified if excludeConstructors or
excludeOneLineMethods is set. Otherwise, the this method is modified.
Parameters: pool - the ConstantPoolGen for this method. Parameters: isModified - describes if this method was previously modified. modified Method version of this MethodModified object. |
|
|