org.obligate.annotations.contract.proxy
Class ContractProxyFactory

java.lang.Object
  extended by org.obligate.annotations.contract.proxy.ContractProxyFactory

public final class ContractProxyFactory
extends java.lang.Object

Simple factory class that returns an contract proxy implementation based on the interface supplied.

Since:
23-Jan-2006
Author:
Steve Jones

Method Summary
static ContractProxyFactory getInstance()
           
<T> T
getProxy(java.lang.Class<T> interfaceClass)
          Get a proxy for the given class.
 boolean isDoValidation()
           
 void setDoValidation(boolean doValidation)
          N.B. This method does not currently propogate the results further.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static final ContractProxyFactory getInstance()
Returns:
the single instance

getProxy

public <T> T getProxy(java.lang.Class<T> interfaceClass)
Get a proxy for the given class. Cases for the proxy are:
  1. Direct - Uses the annotation from the interface if it is there
  2. Factory Indirect - Loads from configuration to determine the class and method to use to obtain the item
  3. Object Indirect - Uses the annotation from the interface to create the indirect implementation

Parameters:
interfaceClass - the class to create the proxy for
Returns:
the proxy

isDoValidation

public final boolean isDoValidation()
Returns:
Returns whether validations is being enabled or not

setDoValidation

public final void setDoValidation(boolean doValidation)
N.B. This method does not currently propogate the results further.

Parameters:
doValidation - set whether FUTURE classes should undertake validations.