org.perfectjpattern.core.api.structural.adapter
Interface IAdapter<T,A>

Type Parameters:
T - Target element type
A - Adaptee element type
All Superinterfaces:
InvocationHandler, ISurrogate<T>
All Known Implementing Classes:
Adapter, EntityManagerAdapter, EntityTransactionAdapter, HibernateQueryAdapter, HibernateSessionAdapter, HibernateTransactionAdapter, JpaQueryAdapter, List2QueueAdapter

public interface IAdapter<T,A>
extends ISurrogate<T>

Adapter Design Pattern: Convert the interface of a class into another interface clients expect. Adapter lets classes work together that couldn't otherwise because of incompatible interfaces.

Responsibility Abstract definition of the "Adapter":

Version:
$Revision: 1.0 $Date: Jan 28, 2009 12:51:08 PM $
Author:
Giovanni Azua
 

Method Summary
 A getAdaptee()
          Returns the Adaptee instance
 T getTarget()
          Returns the Target instance
 void setAdaptingStrategy(IAdaptingStrategy anAdaptingStrategy)
          Sets the adapting strategy e.g.
 
Methods inherited from interface org.perfectjpattern.core.api.structural.ISurrogate
getComponent
 
Methods inherited from interface java.lang.reflect.InvocationHandler
invoke
 

Method Detail

getTarget

T getTarget()
Returns the Target instance

Returns:
Target instance

getAdaptee

A getAdaptee()
Returns the Adaptee instance

Returns:
Adaptee instance

setAdaptingStrategy

void setAdaptingStrategy(IAdaptingStrategy anAdaptingStrategy)
                         throws IllegalArgumentException
Sets the adapting strategy e.g. exact, name, user-defined

Parameters:
anAdaptingStrategy - IAdaptingStrategy instance to assign
Throws:
IllegalArgumentException - 'anAdaptingStrategy' must not be null


Copyright © 2007-2009. All Rights Reserved.