org.perfectjpattern.core.api.structural.adapter
Interface IAdaptingStrategy

All Superinterfaces:
IStrategy
All Known Implementing Classes:
ExactMatchAdaptingStrategy, NameMatchAdaptingStrategy

public interface IAdaptingStrategy
extends IStrategy

Abstract definition of the adapting strategy to use e.g.

Version:
$Revision: 1.0 $Date: Jan 28, 2009 1:00:42 PM $
Author:
Giovanni Azua
 

Method Summary
 Method resolve(Class<?> aTargetClass, Object anAdaptee, Object anAdapter, Method aTargetMethod)
          Returns the Adaptee or otherwise Adapter method that corresponds to the given Target class type.
 void validate(Class<?> aTargetClass, Object anAdaptee, Object anAdapter)
          According to the definition of this strategy validates the tuple Target/Adaptee.
 

Method Detail

validate

void validate(Class<?> aTargetClass,
              Object anAdaptee,
              Object anAdapter)
              throws NoSuchMethodError
According to the definition of this strategy validates the tuple Target/Adaptee. Should the two not match an NoSuchMethodError will be thrown.

Parameters:
aTargetClass - Target class type
anAdaptee - Adaptee instance
anAdapter - Adapter instance
Throws:
NoSuchMethodError

resolve

Method resolve(Class<?> aTargetClass,
               Object anAdaptee,
               Object anAdapter,
               Method aTargetMethod)
               throws NoSuchMethodError
Returns the Adaptee or otherwise Adapter method that corresponds to the given Target class type. If the corresponding method is not found an NoSuchMethodError will be thrown.

Parameters:
aTargetClass - Target class type
anAdaptee - Adaptee instance
anAdapter - Adapter instance
aTargetMethod - Target method to search for in the Adaptee
Returns:
Adaptee method that corresponds to the given Target class type
Throws:
NoSuchMethodError
See Also:
validate(Class, Object, Object)


Copyright © 2007-2009. All Rights Reserved.