Class ModuleItemInfoImpl
- java.lang.Object
-
- ru.vyarus.dropwizard.guice.module.context.info.impl.ItemInfoImpl
-
- ru.vyarus.dropwizard.guice.module.context.info.impl.InstanceItemInfoImpl<com.google.inject.Module>
-
- ru.vyarus.dropwizard.guice.module.context.info.impl.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
-
-
Field Summary
-
Fields inherited from class ru.vyarus.dropwizard.guice.module.context.info.impl.ItemInfoImpl
complete
-
-
Constructor Summary
Constructors Constructor Description ModuleItemInfoImpl(com.google.inject.Module module)Create item.ModuleItemInfoImpl(java.lang.Class<? extends com.google.inject.Module> type)Create disabled-only item (without an actual item).
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Set<ItemId>getDisabledBy()Item may be disabled either from root application class or fromGuiceyBundle.booleanisEnabled()Item is enabled if no one disable it (DisableSupport.getDisabledBy()is empty).booleanisOverriding()static voidoverrideScope(java.lang.Runnable action)Use to register overriding modules.-
Methods inherited from class ru.vyarus.dropwizard.guice.module.context.info.impl.InstanceItemInfoImpl
getDuplicates, getInstance, getInstanceCount, setInstanceCount, toString
-
Methods inherited from class ru.vyarus.dropwizard.guice.module.context.info.impl.ItemInfoImpl
countRegistrationAttempt, getId, getIgnoresByScope, getIgnoresByScope, getItemType, getRegisteredBy, getRegistrationAttempts, getRegistrationScope, getRegistrationScopeType, getType, isAllDataCollected, isRegistered, isRegisteredDirectly
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface ru.vyarus.dropwizard.guice.module.context.info.InstanceItemInfo
getDuplicates, getInstance, getInstanceCount
-
Methods inherited from interface ru.vyarus.dropwizard.guice.module.context.info.ItemInfo
getId, getIgnoresByScope, getIgnoresByScope, getItemType, getRegisteredBy, getRegistrationAttempts, getRegistrationScope, getRegistrationScopeType, getType, isAllDataCollected, isRegistered, isRegisteredDirectly
-
-
-
-
Constructor Detail
-
ModuleItemInfoImpl
public ModuleItemInfoImpl(java.lang.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 Detail
-
getDisabledBy
public java.util.Set<ItemId> getDisabledBy()
Description copied from interface:DisableSupportItem may be disabled either from root application class or fromGuiceyBundle. For application,Applicationclass stored as context and for guicey bundle actual bundle instance id is stored.- Specified by:
getDisabledByin interfaceDisableSupport- Returns:
- contexts where item was disabled or empty collection
-
isEnabled
public boolean isEnabled()
Description copied from interface:DisableSupportItem is enabled if no one disable it (DisableSupport.getDisabledBy()is empty).- Specified by:
isEnabledin interfaceDisableSupport- Returns:
- true if item enabled, false otherwise
-
isOverriding
public boolean isOverriding()
- Specified by:
isOverridingin interfaceModuleItemInfo- Returns:
- true if overriding module (module overrides bindings of other modules), false if normal module
-
overrideScope
public static void overrideScope(java.lang.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
-
-