public static final class ExtensionPoint.InstanceMap<K,V> extends ExtensionPoint
ExtensionPoint.ClassMap<T>, ExtensionPoint.ClassSet<T>, ExtensionPoint.InstanceMap<K,V>, ExtensionPoint.SelectedType<T>
name, singletons
Constructor and Description |
---|
InstanceMap(java.lang.String name,
java.lang.Class<K> keyType,
java.lang.Class<V> valueType,
java.lang.Class<?>... singletons)
Creates a new
ExtensionPoint.ClassSet |
Modifier and Type | Method and Description |
---|---|
protected void |
bindExtensions(Binder binder)
Subclasses can bind their type, map or set extensions here.
|
void |
registerExtension(K key,
V value)
Registers a mapping from
key to value |
bind
public InstanceMap(java.lang.String name, java.lang.Class<K> keyType, java.lang.Class<V> valueType, java.lang.Class<?>... singletons)
ExtensionPoint.ClassSet
name
- the human readable underscore case name of the extension point. This is used in error messages.singletons
- a list of singletons to bind with this extension point - these are bound in ExtensionPoint.bind(Binder)
public void registerExtension(K key, V value)
key
to value
java.lang.IllegalArgumentException
- iff the key is already registeredprotected void bindExtensions(Binder binder)
ExtensionPoint
bindExtensions
in class ExtensionPoint