Enum Class ConfigScope
- All Implemented Interfaces:
Serializable,Comparable<ConfigScope>,Constable
Enum with type constants used for marking special configuration scopes. Guicey bundles are also
scopes: all items registered by guicey bunlde is scoped with bundle type.
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.
- Since:
- 16.04.2018
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionApplication scope: everything registered directly in guice bundle's builder.Lookup scope contains all bundles, resolved with lookup mechanism.Everything resolved with classpath scan.WARNING: dropwizard bundle scope is bundle class itself.WARNING: guicey bundle scope is bundle class itself.All configurations done byGuiceyConfigurationHook(most likely in integration tests).WARNING: binding extension scope is guice module name itself (not direct module, but topmost registered module - visible in configuration).Special scope for optional extensions automatic disabling (when no matching installer available). -
Method Summary
Modifier and TypeMethodDescriptionstatic Class[]allExcept(ConfigScope scope) Useful for hiding all special scopes except one in diagnostic report.getKey()Class<?>getType()static ConfigScopeScope recognition logic may be used in configuration analyzers to easily detect item scope.static ConfigScopeShortcut forrecognize(Class).static ConfigScopeReturns the enum constant of this class with the specified name.static ConfigScope[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
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. -
Hook
All configurations done byGuiceyConfigurationHook(most likely in integration tests). -
GuiceyBundle
WARNING: guicey bundle scope is bundle class itself. Constant is useless for direct usage! It was added just for completeness of context recognition logic (seerecognize(Class)) and to indicate all possible scopes. -
DropwizardBundle
WARNING: dropwizard bundle scope is bundle class itself. Constant is useless for direct usage! It was added just for completeness of context recognition logic (seerecognize(Class)) and to indicate all possible scopes. -
Module
WARNING: binding extension scope is guice module name itself (not direct module, but topmost registered module - visible in configuration). It was added just for completeness of context recognition logic (seerecognize(Class)) and to indicate all possible scopes. -
OptionalExtensionDisable
Special scope for optional extensions automatic disabling (when no matching installer available). Extra scope is required to differentiate automatic disabling from manual.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
getType
- Returns:
- class used for special scope identification
-
getKey
- Returns:
- scope key
-
allExcept
Useful for hiding all special scopes except one in diagnostic report.- Parameters:
scope- scope to exclude- Returns:
- all special scopes except provided
-
recognize
Shortcut forrecognize(Class).- Parameters:
id- scope key- Returns:
- recognized scope type
-
recognize
Scope recognition logic may be used in configuration analyzers to easily detect item scope.- Parameters:
type- type to recognize scope- Returns:
- recognized scope
- Throws:
IllegalStateException- is scope is not recognizable
-