com.didana.codecontract.core
Class ContractHandler

java.lang.Object
  extended by com.didana.codecontract.core.ContractHandler

public class ContractHandler
extends java.lang.Object

This class extracts contract values representing pre and post conditions specified on methods and class invariants.

Author:
Diana Berberova

Constructor Summary
ContractHandler()
           
 
Method Summary
static java.util.ArrayList<java.lang.String> getClassInvariants(java.lang.Class classInstance)
          Returns the contract expression defined as class invariants that are declared directly in the class.
static java.lang.reflect.Constructor getConstructorBySignature(java.lang.Class classInstance, java.lang.String signature)
          Returns constructor object represnted by the parameter signature.
static java.util.ArrayList<java.lang.String> getConstructorContracts(java.lang.Class classInstance, java.lang.Class annotationType, java.lang.String signature)
          Returns the contract expression defined on constructors method.
static java.util.ArrayList<java.lang.String> getContracts(java.lang.Class classInstance, java.lang.Class annotationType, java.lang.String signature, boolean getInvariants)
          Returns the contract expressions defined on non static methods.
static java.util.ArrayList<java.lang.String> getInvariants(java.lang.Class classInstance)
          Returns the contract expression defined as class invariants declared in the class hierarchy.
static java.lang.reflect.Method getMethodBySignature(java.lang.Class classInstance, java.lang.String signature)
          Returns method object represnted by the parameter signature.
static java.lang.String getStaticContracts(java.lang.Class classInstance, java.lang.Class annotationType, java.lang.String signature)
          Returns the contract expression defined on static method.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ContractHandler

public ContractHandler()
Method Detail

getContracts

public static java.util.ArrayList<java.lang.String> getContracts(java.lang.Class classInstance,
                                                                 java.lang.Class annotationType,
                                                                 java.lang.String signature,
                                                                 boolean getInvariants)
Returns the contract expressions defined on non static methods.


getStaticContracts

public static java.lang.String getStaticContracts(java.lang.Class classInstance,
                                                  java.lang.Class annotationType,
                                                  java.lang.String signature)
Returns the contract expression defined on static method.


getConstructorContracts

public static java.util.ArrayList<java.lang.String> getConstructorContracts(java.lang.Class classInstance,
                                                                            java.lang.Class annotationType,
                                                                            java.lang.String signature)
Returns the contract expression defined on constructors method.


getClassInvariants

public static java.util.ArrayList<java.lang.String> getClassInvariants(java.lang.Class classInstance)
Returns the contract expression defined as class invariants that are declared directly in the class.


getInvariants

public static java.util.ArrayList<java.lang.String> getInvariants(java.lang.Class classInstance)
Returns the contract expression defined as class invariants declared in the class hierarchy.


getMethodBySignature

public static java.lang.reflect.Method getMethodBySignature(java.lang.Class classInstance,
                                                            java.lang.String signature)
Returns method object represnted by the parameter signature.


getConstructorBySignature

public static java.lang.reflect.Constructor getConstructorBySignature(java.lang.Class classInstance,
                                                                      java.lang.String signature)
Returns constructor object represnted by the parameter signature.