Class ModuleItemInfoImpl

All Implemented Interfaces:
InstanceItemInfo<com.google.inject.Module>, ItemInfo, ModuleItemInfo, DisableSupport

public class ModuleItemInfoImpl extends InstanceItemInfoImpl<com.google.inject.Module> implements ModuleItemInfo
Module item info implementation.
Since:
03.04.2018
  • Constructor Details

    • ModuleItemInfoImpl

      public ModuleItemInfoImpl(Class<? extends com.google.inject.Module> type)
      Create disabled-only item (without an actual item).
      Parameters:
      type - item type
    • ModuleItemInfoImpl

      public ModuleItemInfoImpl(com.google.inject.Module module)
      Create item.
      Parameters:
      module - module instance
  • Method Details

    • getDisabledBy

      public Set<ItemId> getDisabledBy()
      Description copied from interface: DisableSupport
      Item may be disabled either from root application class or from GuiceyBundle. For application, Application class stored as context and for guicey bundle actual bundle instance id is stored.
      Specified by:
      getDisabledBy in interface DisableSupport
      Returns:
      contexts where item was disabled or empty collection
    • isEnabled

      public boolean isEnabled()
      Description copied from interface: DisableSupport
      Item is enabled if no one disable it (DisableSupport.getDisabledBy() is empty).
      Specified by:
      isEnabled in interface DisableSupport
      Returns:
      true if item enabled, false otherwise
    • isOverriding

      public boolean isOverriding()
      Specified by:
      isOverriding in interface ModuleItemInfo
      Returns:
      true if overriding module (module overrides bindings of other modules), false if normal module
    • overrideScope

      public static void overrideScope(Runnable action)
      Use to register overriding modules. Such complex approach was used because overriding modules is the only item that require additional parameter during registration. This parameter may be used in disable predicate to differentiate overriding modules from normal modules.
      Parameters:
      action - registration action