com.futureshocked.classloader
Class InterceptedMethod

java.lang.Object
  extended by com.futureshocked.classloader.InterceptedMethod

public class InterceptedMethod
extends java.lang.Object

InterceptedMethod contains the class name, method name, method description, and information relating to which code modifications should be done to this method.


Field Summary
private  boolean addRecursionLimiter
          true if this method should have it's recursion limited.
private  boolean addStaticDebuggerCall
          true if this method should have a static debugger call inserted.
private  java.lang.String className
          The name of the class this method belongs to.
private  java.lang.String description
          The method description - if null will match all overloaded methods with the same name.
private  int maxRecursionCount
          The maximum recusion level for this class (if limited).
private  java.lang.String methodName
          The name of the method to intercept.
private  int staticDebuggerCount
          The maximum depth for the static debugger.
 
Constructor Summary
InterceptedMethod(java.lang.String clazz, java.lang.String method)
          Constructor that sets description to null - ie: match all overloaded methods.
InterceptedMethod(java.lang.String clazz, java.lang.String method, java.lang.String desc)
          Constructor that sets all matching variables - ie: match specific method
 
Method Summary
 java.lang.String getClassName()
           
 java.lang.String getDescription()
           
 int getMaxRecursionCount()
           
 java.lang.String getMethodName()
           
 int getStaticDebuggerCallDepth()
           
 boolean matches(java.lang.String className, java.lang.String method, java.lang.String desc)
          Used to match this object against a method being visited.
 boolean needsRecursionLimiter()
          Checks to see if this method should have it's recursion limited.
 boolean needsStaticDebuggerCall()
          Checks to see if this method should have a static debugger call inserted.
 void removeRecursionLimiter()
           
 void removeStaticDebuggerCall()
           
 void setClassName(java.lang.String className)
           
 void setDescription(java.lang.String description)
           
 void setMethodName(java.lang.String methodName)
           
 void setRecursionLimiter(int maxRecursionDepth)
           
 void setStaticDebuggerCall(int maxRecursionDepth)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

className

private java.lang.String className
The name of the class this method belongs to.


methodName

private java.lang.String methodName
The name of the method to intercept.


description

private java.lang.String description
The method description - if null will match all overloaded methods with the same name. For more information on the format for description see the ASM documentation.

For example, a method like:
public String getSomeString(InterceptedMethod im, int count)
has a description of:
(Lcom.futureshocked.classloader.InterceptedMethod;I)Ljava.lang.String;


staticDebuggerCount

private int staticDebuggerCount
The maximum depth for the static debugger.


maxRecursionCount

private int maxRecursionCount
The maximum recusion level for this class (if limited).


addStaticDebuggerCall

private boolean addStaticDebuggerCall
true if this method should have a static debugger call inserted.


addRecursionLimiter

private boolean addRecursionLimiter
true if this method should have it's recursion limited.

Constructor Detail

InterceptedMethod

public InterceptedMethod(java.lang.String clazz,
                         java.lang.String method)
Constructor that sets description to null - ie: match all overloaded methods.

Parameters:
clazz - The name of the class.
method - The name of the method.

InterceptedMethod

public InterceptedMethod(java.lang.String clazz,
                         java.lang.String method,
                         java.lang.String desc)
Constructor that sets all matching variables - ie: match specific method

Parameters:
clazz - The name of the class.
method - The name of the method.
desc - The method description.
Method Detail

matches

public boolean matches(java.lang.String className,
                       java.lang.String method,
                       java.lang.String desc)
Used to match this object against a method being visited.

Note that matches is not the same as equals() - matches is not reflexive, in that fields 'methodName' and 'description' will not be used for comparison if they are null in THIS object (however if they are non-null in this instance but null in params passed in they will be used for matching, and return false.

Parameters:
className - The name of the class currently being visited.
method - The name of the method currently being visited.
desc - The description of the method currently being visited.
Returns:
true if the currently visited method should be modified

getClassName

public java.lang.String getClassName()

setClassName

public void setClassName(java.lang.String className)

getMethodName

public java.lang.String getMethodName()

setMethodName

public void setMethodName(java.lang.String methodName)

getDescription

public java.lang.String getDescription()

setDescription

public void setDescription(java.lang.String description)

needsStaticDebuggerCall

public boolean needsStaticDebuggerCall()
Checks to see if this method should have a static debugger call inserted.

Returns:
true if this method should be modified.

getStaticDebuggerCallDepth

public int getStaticDebuggerCallDepth()

setStaticDebuggerCall

public void setStaticDebuggerCall(int maxRecursionDepth)

removeStaticDebuggerCall

public void removeStaticDebuggerCall()

needsRecursionLimiter

public boolean needsRecursionLimiter()
Checks to see if this method should have it's recursion limited.

Returns:
true if this method should be modified.

getMaxRecursionCount

public int getMaxRecursionCount()

setRecursionLimiter

public void setRecursionLimiter(int maxRecursionDepth)

removeRecursionLimiter

public void removeRecursionLimiter()