public class ItemInfoImpl extends java.lang.Object implements ItemInfo
| Constructor and Description |
|---|
ItemInfoImpl(ConfigItem itemType,
ItemId id) |
| Modifier and Type | Method and Description |
|---|---|
void |
countRegistrationAttempt(ItemId scope) |
ItemId |
getId()
Items could be registered by class and by instance.
|
int |
getIgnoresByScope(java.lang.Class<?> scope)
Shortcut for
ItemInfo.getIgnoresByScope(ItemId). |
int |
getIgnoresByScope(ItemId scope)
Required to show ignored items in the same scope as actual registration.
|
ConfigItem |
getItemType() |
java.util.Set<ItemId> |
getRegisteredBy()
Configuration items may be registered by root application class, classpath scan or guicey bundle.
|
int |
getRegistrationAttempts()
It may be 0 for disabled items (e.g. installer disabled but never registered).
|
ItemId |
getRegistrationScope()
Item may be registered multiple times.
|
ConfigScope |
getRegistrationScopeType()
It is essentially the same as
ItemInfo.getRegistrationScope(), but with generified guicey bundle scope. |
java.lang.Class<?> |
getType() |
boolean |
isRegistered()
Useful to recognize not registered info items appeared for example because of item disabling.
|
boolean |
isRegisteredDirectly() |
java.lang.String |
toString() |
public ItemInfoImpl(ConfigItem itemType, ItemId id)
public ItemId getId()
ItemInfopublic ConfigItem getItemType()
getItemType in interface ItemInfopublic java.lang.Class<?> getType()
public java.util.Set<ItemId> getRegisteredBy()
ItemInfoApplication 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.
getRegisteredBy in interface ItemInfofor the list of all special scopespublic int getRegistrationAttempts()
ItemInfogetRegistrationAttempts in interface ItemInfopublic boolean isRegistered()
ItemInfoisRegistered in interface ItemInfopublic boolean isRegisteredDirectly()
isRegisteredDirectly in interface ItemInfoGuiceBundle.Builder,
false otherwise.public ItemId getRegistrationScope()
ItemInfoDuplicateConfigDetector).
May be null for never registered but disabled items!
getRegistrationScope in interface ItemInfofor all scopes performing registratoinpublic ConfigScope getRegistrationScopeType()
ItemInfoItemInfo.getRegistrationScope(), but with generified guicey bundle scope.
May be useful for generic reporting.getRegistrationScopeType in interface ItemInfopublic int getIgnoresByScope(ItemId scope)
ItemInfo
When checked bundles by class only item (ItemId.from(Bundle.class)) it wil return sum
of registrations for all instances of type.
getIgnoresByScope in interface ItemInfoscope - scopepublic int getIgnoresByScope(java.lang.Class<?> scope)
ItemInfoItemInfo.getIgnoresByScope(ItemId).getIgnoresByScope in interface ItemInfoscope - scope type to check ignorespublic void countRegistrationAttempt(ItemId scope)
public java.lang.String toString()
toString in class java.lang.Object