Class Filters
java.lang.Object
ru.vyarus.dropwizard.guice.module.context.Filters
Common filters for configuration information filtering in
ConfigurationInfo.getItems(ConfigItem, Predicate) and
ConfigurationInfo.getItems(Predicate).
Use Predicate.and(Predicate), Predicate.or(Predicate) and Predicate.negate()
to reuse default filters.- Since:
- 06.07.2016
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T extends BundleItemInfo>
Predicate<T>bundles()Guicey and dropwizard bundles are pretty much unified and likely to be queried together for reporting.disabled()Filter for disabled items.disabledBy(Class<?> type) Shortcut fordisabledBy(ItemId).disabledBy(ItemId scope) Filter for items disabled in specified scope.static Predicate<GuiceyBundleItemInfo>enabled()Filter for enabled items.static Predicate<ExtensionItemInfo>static Predicate<ExtensionItemInfo>Filter for extensions detected from guice bindings.fromScan()Filter for items registered with classpath scan.static Predicate<GuiceyBundleItemInfo>static Predicate<ExtensionItemInfo>installedBy(Class<? extends FeatureInstaller> type) Filter for extensions installed by specified installer.static Predicate<InstallerItemInfo>static Predicate<ExtensionItemInfo>Filter for jersey extensions.static Predicate<GuiceyBundleItemInfo>Filter for bundles resolved by lookup mechanism.static Predicate<ModuleItemInfo>modules()static Predicate<ModuleItemInfo>Filter for overriding modules.registeredBy(Class<?> type) Shortcut forregisteredBy(ItemId)for scope classes.registeredBy(ConfigScope specialScope) Shortcut forregisteredBy(ItemId)for special scopes (like classpath scan, bundles lookup etc).registeredBy(ItemId scope) In contrast toregistrationScope(ItemId)this filter returns item for all scopes mentioned item (including scopes where registration was considered duplicate).registrationScope(Class<?> type) Shortcut forregistrationScope(ItemId).registrationScope(ConfigScope specialScope) Shortcut forregistrationScope(ItemId)for special scopes (like classpath scan, bundles lookup etc).registrationScope(ItemId scope) Filter for items registered by specified context.static Predicate<BundleItemInfo>Filter for transitive bundles: bundles registered only by other bundles (and never directly).Filter used for instance items (bundle, module) selection by type.type(ConfigItem... types) Filter used for multi-type searches to filter out item types.static Predicate<ExtensionItemInfo>Filter for web extensions (everything web-related, including jersey extensions).
-
Method Details
-
enabled
Filter for enabled items. Not all items support disable (DisableSupport). Items not supporting disable considered enabled (so it's safe to apply filter for all items).- Type Parameters:
T- expected info container type (if used within single configuration type)- Returns:
- enabled items filter
-
disabled
Filter for disabled items. Not all items support disable (DisableSupport). Items not supporting disable considered enabled (so it's safe to apply filter for all items).- Type Parameters:
T- expected info container type (if used within single configuration type)- Returns:
- enabled items filter
-
disabledBy
Filter for items disabled in specified scope. Not all items support disable (DisableSupport). Items not supporting disable considered enabled (so it's safe to apply filter for all items).- Type Parameters:
T- expected info container type (if used within single configuration type)- Parameters:
scope- target scope- Returns:
- items disabled in scope filter
-
disabledBy
Shortcut fordisabledBy(ItemId).- Type Parameters:
T- expected info container type (if used within single configuration type)- Parameters:
type- target scope type- Returns:
- items disabled in scope filter
-
fromScan
Filter for items registered with classpath scan. Not all items support classpath scanScanSupport. Items not supporting scan are considered not resolved by scan (so it's safe to apply filter for all items).- Type Parameters:
T- expected info container type (if used within single configuration type)- Returns:
- items from classpath scan filter
-
registrationScope
Filter for items registered by specified context. Context class could beApplication,ClasspathScanner,GuiceyBundleLookupand classes implementingGuiceyBundle. Safe to apply filter for all items.Note: counts only actual registration, ignoring duplicate (rejected) registrations (see
registeredBy(Class)for filter counting all registrations).Note: if scope key contain class only (without instance identity) and multiple scope instances were registered, then all object from all instance scopes will be returned.
- Type Parameters:
T- expected info container type (if used within single configuration type)- Parameters:
scope- scope class- Returns:
- items registered in specified context filter
- See Also:
-
registrationScope
Shortcut forregistrationScope(ItemId)for special scopes (like classpath scan, bundles lookup etc).- Type Parameters:
T- expected info container type (if used within single configuration type)- Parameters:
specialScope- special scope type- Returns:
- items registered in specified context filter
-
registrationScope
Shortcut forregistrationScope(ItemId).Note: if type is a bundle type and multiple bundle instances were registered, then all registered items from all bundle instances will be returned (will affect multiple scopes).
- Type Parameters:
T- expected info container type (if used within single configuration type)- Parameters:
type- scope type- Returns:
- items registered in specified context filter
-
registeredBy
In contrast toregistrationScope(ItemId)this filter returns item for all scopes mentioned item (including scopes where registration was considered duplicate).- Type Parameters:
T- expected info container type (if used within single configuration type)- Parameters:
scope- scope key- Returns:
- items registered in specified context filter
- See Also:
-
registeredBy
Shortcut forregisteredBy(ItemId)for special scopes (like classpath scan, bundles lookup etc).- Type Parameters:
T- expected info container type (if used within single configuration type)- Parameters:
specialScope- special scope type- Returns:
- items registered in specified context filter
-
registeredBy
Shortcut forregisteredBy(ItemId)for scope classes.- Type Parameters:
T- expected info container type (if used within single configuration type)- Parameters:
type- scope class- Returns:
- items registered in specified context filter
-
type
Filter used for multi-type searches to filter out item types. In order to filter out only one type, may be used in conjunction withPredicate.negate().- Type Parameters:
T- expected info container type (if used within single configuration type)- Parameters:
types- item types to match- Returns:
- items of type filter
-
type
Filter used for instance items (bundle, module) selection by type.- Type Parameters:
T- expected info container type (if used within single configuration type)- Parameters:
type- item class- Returns:
- items of class filter
-
lookupBundles
Filter for bundles resolved by lookup mechanism. Use only forConfigItem.Bundleitems.- Returns:
- bundles resolved by lookup filter
-
transitiveBundles
Filter for transitive bundles: bundles registered only by other bundles (and never directly). Applied to both guicey and dropwizard bundles.- Returns:
- transitive bundled filter
-
bundles
Guicey and dropwizard bundles are pretty much unified and likely to be queried together for reporting.- Type Parameters:
T- expected info container type (if used within single configuration type)- Returns:
- bundle predicate (guicey or dropwizard)
-
guiceyBundles
- Returns:
- guicey bundles predicate
-
dropwizardBundles
- Returns:
- dropwizard bundles predicate
-
extensions
- Returns:
- extensions predicate
-
installedBy
Filter for extensions installed by specified installer. Use only forConfigItem.Extensionitems.- Parameters:
type- installer class- Returns:
- extensions installed by specified installer filter
-
fromBinding
Filter for extensions detected from guice bindings. Use only forConfigItem.Extensionitems.- Returns:
- extensions resolved from binding filter
-
webExtension
Filter for web extensions (everything web-related, including jersey extensions). Use only forConfigItem.Extensionitems.- Returns:
- web extensions matcher
-
jerseyExtension
Filter for jersey extensions. Use only forConfigItem.Extensionitems.- Returns:
- jersey extensions matcher
-
modules
- Returns:
- guice modules predicate
-
overridingModule
Filter for overriding modules. Use only forConfigItem.Moduleitems.- Returns:
- overriding modules filter
-
installers
- Returns:
- installers predicate
-