Class ItemInfoImpl

    • Constructor Detail

    • Method Detail

      • getId

        public ItemId getId()
        Description copied from interface: ItemInfo
        Items could be registered by class and by instance. In case of instance registration, multiple instances could be provided with the same class. For class registrations item id is equal to pure class.
        Specified by:
        getId in interface ItemInfo
        Returns:
        item identity
      • getItemType

        public ConfigItem getItemType()
        Specified by:
        getItemType in interface ItemInfo
        Returns:
        configuration item type (e.g. installer, bundle, extension etc)
      • getType

        public java.lang.Class<?> getType()
        Specified by:
        getType in interface ItemInfo
        Returns:
        actual item class
      • getRegisteredBy

        public java.util.Set<ItemId> getRegisteredBy()
        Description copied from interface: ItemInfo
        Configuration items may be registered by root application class, classpath scan or guicey bundle. For registrations in application class Application is stored as context. For registration by classpath scan ClasspathScanner is stored as context. For registrations by GuiceyBundle, actual bundle class is stored as context. Bundle items may also have GuiceyBundleLookup as context classe for bundles resolved by lookup mechanism.

        May not contain elements if item was never registered, but for example, disabled.

        To quick check if exact scope class is present use ItemId.from(class), which will match any class instance related scope key.

        Specified by:
        getRegisteredBy in interface ItemInfo
        Returns:
        context classes which register item or empty collection
        See Also:
        for the list of all special scopes
      • getRegistrationAttempts

        public int getRegistrationAttempts()
        Description copied from interface: ItemInfo
        It may be 0 for disabled items (e.g. installer disabled but never registered). Also, count may be greater than registration sources count, because the same source could register item multiple times.
        Specified by:
        getRegistrationAttempts in interface ItemInfo
        Returns:
        count of item registrations
      • isRegistered

        public boolean isRegistered()
        Description copied from interface: ItemInfo
        Useful to recognize not registered info items appeared for example because of item disabling.
        Specified by:
        isRegistered in interface ItemInfo
        Returns:
        true if item was registered, false otherwise
      • getRegistrationScope

        public ItemId getRegistrationScope()
        Description copied from interface: ItemInfo
        Item may be registered multiple times. For class items (e.g. extension) only first scope will be actual registration scope (and registrations from other scopes will be simply ignored). For instance items (bundle, module), different objects of the same type will be registered according to DuplicateConfigDetector).

        May be null for never registered but disabled items!

        Specified by:
        getRegistrationScope in interface ItemInfo
        Returns:
        registration scope
        See Also:
        for all scopes performing registratoin
      • getIgnoresByScope

        public int getIgnoresByScope​(ItemId scope)
        Description copied from interface: ItemInfo
        Required to show ignored items in the same scope as actual registration.

        When checked bundles by class only item (ItemId.from(Bundle.class)) it wil return sum of registrations for all instances of type.

        Specified by:
        getIgnoresByScope in interface ItemInfo
        Parameters:
        scope - scope
        Returns:
        number of ignored items in scope
      • getIgnoresByScope

        public int getIgnoresByScope​(java.lang.Class<?> scope)
        Description copied from interface: ItemInfo
        Specified by:
        getIgnoresByScope in interface ItemInfo
        Parameters:
        scope - scope type to check ignores
        Returns:
        number of ignored items in all scopes of specified type
      • countRegistrationAttempt

        public void countRegistrationAttempt​(ItemId scope)
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object