net.sourceforge.c4j
Class ContractBase<T>

java.lang.Object
  extended by net.sourceforge.c4j.ContractBase<T>

public class ContractBase<T>
extends java.lang.Object


Field Summary
protected  T m_target
           
 
Constructor Summary
protected ContractBase()
           
protected ContractBase(T target)
           
 
Method Summary
static void addLogger(Logger logger)
           
static void classInvariantCheck(java.lang.String className)
           
protected  java.lang.Object getPreconditionValue(java.lang.String name)
           
protected  java.lang.Object getReturnValue()
           
 java.lang.Object getTargetField(java.lang.String name)
           
 void popPreconditionValuesMap()
           
 void popReturnValue()
           
static void postConditionCheck(java.lang.String className, java.lang.String method, java.lang.Object[] parameters)
           
static void preConditionCheck(java.lang.String className, java.lang.String method, java.lang.Object[] parameters)
           
 void pushPreconditionValuesMap()
          The following methods must only be called by instrumented code.
 void pushReturnValue()
           
protected  void setPreconditionValue(java.lang.String name, java.lang.Object value)
           
 void setReturnValue(java.lang.Object value)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_target

protected T m_target
Constructor Detail

ContractBase

protected ContractBase()

ContractBase

protected ContractBase(T target)
Method Detail

setPreconditionValue

protected void setPreconditionValue(java.lang.String name,
                                    java.lang.Object value)

getPreconditionValue

protected java.lang.Object getPreconditionValue(java.lang.String name)

getReturnValue

protected java.lang.Object getReturnValue()

addLogger

public static void addLogger(Logger logger)

getTargetField

public java.lang.Object getTargetField(java.lang.String name)

pushPreconditionValuesMap

public void pushPreconditionValuesMap()
The following methods must only be called by instrumented code. They need to be public though so that any instrumented class can access them.


popPreconditionValuesMap

public void popPreconditionValuesMap()

pushReturnValue

public void pushReturnValue()

setReturnValue

public void setReturnValue(java.lang.Object value)

popReturnValue

public void popReturnValue()

classInvariantCheck

public static void classInvariantCheck(java.lang.String className)

preConditionCheck

public static void preConditionCheck(java.lang.String className,
                                     java.lang.String method,
                                     java.lang.Object[] parameters)

postConditionCheck

public static void postConditionCheck(java.lang.String className,
                                      java.lang.String method,
                                      java.lang.Object[] parameters)