public enum ConfigScope extends java.lang.Enum<ConfigScope>
Scope represents configuration source (configuration entry point). Because bundle could be installed multiple
times - it would multiple scopes with the same class and to identify scopes special abstraction is used:
ItemId:combination of type + instance identity.
| Enum Constant and Description |
|---|
Application
Application scope: everything registered directly in guice bundle's builder.
|
BundleLookup
Lookup scope contains all bundles, resolved with lookup mechanism.
|
ClasspathScan
Everything resolved with classpath scan.
|
DropwizardBundle
WARNING: dropwizard bundle scope is bundle class itself.
|
GuiceyBundle
WARNING: guicey bundle scope is bundle class itself.
|
Hook
All configurations done by
GuiceyConfigurationHook (most likely in integration tests). |
Module
WARNING: binding extension scope is guice module name itself (not direct module, but topmost registered
module - visible in configuration).
|
| Modifier and Type | Method and Description |
|---|---|
static java.lang.Class[] |
allExcept(ConfigScope scope)
Useful for hiding all special scopes except one in diagnostic report.
|
ItemId |
getKey() |
java.lang.Class<?> |
getType() |
static ConfigScope |
recognize(java.lang.Class<?> type)
Scope recognition logic may be used in configuration analyzers to easily detect item scope.
|
static ConfigScope |
recognize(ItemId id)
Shortcut for
recognize(Class). |
static ConfigScope |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static ConfigScope[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final ConfigScope Application
public static final ConfigScope BundleLookup
public static final ConfigScope ClasspathScan
public static final ConfigScope Hook
GuiceyConfigurationHook (most likely in integration tests).public static final ConfigScope GuiceyBundle
recognize(Class))
and to indicate all possible scopes.public static final ConfigScope DropwizardBundle
recognize(Class))
and to indicate all possible scopes.public static final ConfigScope Module
recognize(Class)) and to indicate all possible scopes.public static ConfigScope[] values()
for (ConfigScope c : ConfigScope.values()) System.out.println(c);
public static ConfigScope valueOf(java.lang.String name)
name - the name of the enum constant to be returned.java.lang.IllegalArgumentException - if this enum type has no constant with the specified namejava.lang.NullPointerException - if the argument is nullpublic java.lang.Class<?> getType()
public ItemId getKey()
public static java.lang.Class[] allExcept(ConfigScope scope)
scope - scope to excludepublic static ConfigScope recognize(ItemId id)
recognize(Class).id - scope keypublic static ConfigScope recognize(java.lang.Class<?> type)
type - type to recognize scopejava.lang.IllegalStateException - is scope is not recognizable