Class AdapterMaps

java.lang.Object
org.eclipse.gef.common.adapt.inject.AdapterMaps

public class AdapterMaps extends Object
A utility class to obtain a MapBinder, via which adapter (map) bindings can be specified in a Module.
  • Method Details

    • getAdapterMapBinder

      public static MapBinder<AdapterKey<?>,Object> getAdapterMapBinder(Binder binder, Class<? extends IAdaptable> adaptableType)
      Returns a MapBinder, which can be used to define adapter bindings for an IAdaptables of the given type.
      Parameters:
      binder - The Binder used to create a new MapBinder.
      adaptableType - The type to be used as type of the AdapterMap.
      Returns:
      A new MapBinder used to define adapter map bindings for the given type (and all sub-types).
    • getAdapterMapBinder

      public static MapBinder<AdapterKey<?>,Object> getAdapterMapBinder(Binder binder, Class<? extends IAdaptable> adaptableType, AdapterKey<?>... adaptableContext)
      Returns a MapBinder, which can be used to define adapter bindings for an IAdaptables of the given type, restricting it further to those IAdaptables that are themselves adapted to another IAdaptable with the specified role.
      Parameters:
      binder - The Binder used to create a new MapBinder.
      adaptableType - The type to be used as type of the AdapterMap.
      adaptableContext - A specification of the context the adaptable, into which adapters are to be injected, has to provide. If specified the injection will be restricted to IAdaptables with a compatible context only. The context of an adaptable is compatible when respective context elements are visited in the given order when walking the adaptable-adapter chain, beginning with the adaptable in which to inject. The actual chain may contain additional elements, that do not correspond to context element, in between (which are ignored), but it has to contain the specified context elements in the given order.
      Returns:
      A new MapBinder used to define adapter map bindings for the given type (and all sub-types).