public static class ExtensionPoint.ClassMap<T> extends ExtensionPoint
ExtensionPoint.ClassMap<T>, ExtensionPoint.ClassSet<T>, ExtensionPoint.InstanceMap<K,V>, ExtensionPoint.SelectedType<T>
Modifier and Type | Field and Description |
---|---|
protected Class<T> |
extensionClass |
name, singletons
Constructor and Description |
---|
ClassMap(String name,
Class<T> extensionClass,
Set<String> reservedKeys,
Class<?>... singletons)
Creates a new
ExtensionPoint.ClassMap |
Modifier and Type | Method and Description |
---|---|
protected void |
bindExtensions(Binder binder)
Subclasses can bind their type, map or set extensions here.
|
Class<? extends T> |
getExtension(String type)
Returns the extension for the given key or
null |
void |
registerExtension(String key,
Class<? extends T> extension)
Registers an extension class for a given key.
|
bind
public ClassMap(String name, Class<T> extensionClass, Set<String> reservedKeys, Class<?>... singletons)
ExtensionPoint.ClassMap
name
- the human readable underscore case name of the extension poing. This is used in error messages etc.extensionClass
- the base class that should be extendedsingletons
- a list of singletons to bind with this extension point - these are bound in ExtensionPoint.bind(Binder)
reservedKeys
- a set of reserved keys by internal implementationspublic Class<? extends T> getExtension(String type)
null
public final void registerExtension(String key, Class<? extends T> extension)
key
- the extensions keyextension
- the extensionIllegalArgumentException
- iff the key is already registered or if the key is a reserved key for an internal implementationprotected final void bindExtensions(Binder binder)
ExtensionPoint
bindExtensions
in class ExtensionPoint
Copyright © 2009–2016. All rights reserved.