com.didana.codecontract.core
Class ObjectHandler

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

public class ObjectHandler
extends java.lang.Object

This class represents the object for which contracts representing conditions are checked at runtime.

Author:
Diana Berberova

Nested Class Summary
static class ObjectHandler.MethodType
           
 
Constructor Summary
ObjectHandler(org.aspectj.lang.JoinPoint joinPoint, java.lang.Class annotationClass)
          Creates new object handler.
 
Method Summary
 boolean checkMethodContracts()
          Evaluates the contracts that are currently active
 java.lang.String getObjectInfo()
          Utility method for printing information about the current object and method called.
 void initializeContracts(ObjectHandler.MethodType methodType)
          Initializes the contracts that are currently active.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ObjectHandler

public ObjectHandler(org.aspectj.lang.JoinPoint joinPoint,
                     java.lang.Class annotationClass)
Creates new object handler.

Parameters:
joinPoint - current joinpoint
annotationClass - the intercepted annotation type
Method Detail

initializeContracts

public void initializeContracts(ObjectHandler.MethodType methodType)
Initializes the contracts that are currently active.

Parameters:
methodType - type of the method that is called - public, non-public, static and constructor

checkMethodContracts

public boolean checkMethodContracts()
Evaluates the contracts that are currently active

Returns:
true if all contract expressions are evaluated to true and false otherwise.

getObjectInfo

public java.lang.String getObjectInfo()
Utility method for printing information about the current object and method called.

Returns:
string value describing the current object