org.eclipse.actf.core.adapt
Interface IAdaptorFactory

All Known Implementing Classes:
DefaultAdaptorFactory

public interface IAdaptorFactory

a factory for creating adaptors. Factories are typically used for specific models using the Configuration.MODEL_ADAPTOR_FACTORY key. A factory instance, once obtained, can be used to find adaptors for a given type.

Author:
Mike Squillace

Method Summary
 IAdaptor[] getAdaptors(Class type)
          retrieves the adaptors for the given type.
 IAdaptor[] getAdaptors(String className)
          retrieves the adaptors for the class name.
 IAdaptor[] getAllAdaptors(Class type)
          retrieves the adaptors not only for the given type but for all types of which this class is assignable.
 void registerAdaptor(Class type, IAdaptor adaptor)
          registers an adaptor for the given type.
 

Method Detail

registerAdaptor

void registerAdaptor(Class type,
                     IAdaptor adaptor)
registers an adaptor for the given type. This type should be returned by the adaptor's getSupportedTypes method.

Parameters:
type - - type for which adaptor is being registered
adaptor -
See Also:
IAdaptor.getSupportedTypes()

getAdaptors

IAdaptor[] getAdaptors(Class type)
retrieves the adaptors for the given type. The adaptors are those that were registered via the registerAdaptor method.

Parameters:
type - - type for which adaptors are desired
Returns:
registered adaptors for the given type or an empty array if no adaptors were registered for the given type

getAdaptors

IAdaptor[] getAdaptors(String className)
retrieves the adaptors for the class name. The adaptors are those that were registered via the registerAdaptor method.

Parameters:
className - - class name for which adaptors are desired
Returns:
registered adaptors for the class name or an empty array if no adaptors were registered for the given name

getAllAdaptors

IAdaptor[] getAllAdaptors(Class type)
retrieves the adaptors not only for the given type but for all types of which this class is assignable. This method differs from getAdaptors in that getAdaptors returns those Adaptors only for that type while this method also tries to determine whether the class type argument is a subclass of a class type registered. For instance, a class type of org.eclipse.swt.widgets.Composite may not have any adaptors registered for it but it is a subclass of org.eclipse.swt.widgets.Control, which may have adaptors registered for it. In any case, all of the adaptors returned are those that were registered via the registerAdaptor method.

Parameters:
type - - type for which adaptors are desired
Returns:
registered adaptors for the given type or any of it's super types, or an empty array if no adaptors were registered for the given type or any of its super types