public static final class ExtensionPoint.SelectedType<T> extends ExtensionPoint.ClassMap<T>
ExtensionPoint.ClassMap
but doesn't instantiate and bind all the registered key value pairs but instead replace a singleton based on a given setting via bindType(Binder, Settings, String, String)
Note: ExtensionPoint.bind(Binder)
is not supported by this classExtensionPoint.ClassMap<T>, ExtensionPoint.ClassSet<T>, ExtensionPoint.InstanceMap<K,V>, ExtensionPoint.SelectedType<T>
extensionClass
name, singletons
Constructor and Description |
---|
SelectedType(java.lang.String name,
java.lang.Class<T> extensionClass) |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
bindType(Binder binder,
Settings settings,
java.lang.String settingsKey,
java.lang.String defaultValue)
Binds the extension class to the class that is registered for the give configured for the settings key in
the settings object.
|
bindExtensions, getExtension, registerExtension
bind
public SelectedType(java.lang.String name, java.lang.Class<T> extensionClass)
public java.lang.String bindType(Binder binder, Settings settings, java.lang.String settingsKey, java.lang.String defaultValue)
binder
- the binder to usesettings
- the settings to look up the key to find the implementation to bindsettingsKey
- the key to use with the settingsdefaultValue
- the default value if the settings do not contain the key, or null if there is no default