org.abstracthorizon.danube.adapter
Class AdapterManager

java.lang.Object
  extended by org.abstracthorizon.danube.adapter.AdapterManager
All Implemented Interfaces:
AdapterFactory

public class AdapterManager
extends Object
implements AdapterFactory

This class is insipired by the similar from eclipse project

Author:
Daniel Sendula

Constructor Summary
AdapterManager()
          Constructor
AdapterManager(AdapterManager parentAdapterManager)
          Constructor
 
Method Summary
<T> T
adapt(T object, Class<T> cls)
          Adopts given object to the instance of the asked class
 Collection<AdapterFactory> getAdapterFactories()
          Returns collection of adapter factories
<T> Class<T>[]
getAdaptingClasses(T object)
          Returns list of classes to which given object can be adopted to by this adopter factory
 AdapterManager getParentAdapterManager()
          Returns parent adapter manager
 void setAdapterFactories(Collection<AdapterFactory> adapterFactories)
          Sets the collection of adapter factories
 void setParentAdapterManager(AdapterManager parentAdapterManager)
          Sets parent adapter manager
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AdapterManager

public AdapterManager()
Constructor


AdapterManager

public AdapterManager(AdapterManager parentAdapterManager)
Constructor

Parameters:
parentAdapterManager - parent adapter manager
Method Detail

getParentAdapterManager

public AdapterManager getParentAdapterManager()
Returns parent adapter manager

Returns:
parent adapter manager

setParentAdapterManager

public void setParentAdapterManager(AdapterManager parentAdapterManager)
Sets parent adapter manager

Parameters:
parentAdapterManager - parent adapter manager

getAdapterFactories

public Collection<AdapterFactory> getAdapterFactories()
Returns collection of adapter factories

Returns:
collection of adapter factories

setAdapterFactories

public void setAdapterFactories(Collection<AdapterFactory> adapterFactories)
Sets the collection of adapter factories

Parameters:
adapterFactories - collection of adapter factories

adapt

public <T> T adapt(T object,
                   Class<T> cls)
Adopts given object to the instance of the asked class

Specified by:
adapt in interface AdapterFactory
Parameters:
object - object to he adopted
cls - asked class
Returns:
adopted given object to the instance of the asked class

getAdaptingClasses

public <T> Class<T>[] getAdaptingClasses(T object)
Returns list of classes to which given object can be adopted to by this adopter factory

Specified by:
getAdaptingClasses in interface AdapterFactory
Returns:
list of classes to which given object can be adopted to


Copyright © 2005-2009 Abstract Horizon. All Rights Reserved.