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 |
|---|
ExtensionPoint.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.
|
bindpublic ExtensionPoint.ClassMap(String name, Class<T> extensionClass, Set<String> reservedKeys, Class<?>... singletons)
ExtensionPoint.ClassMapname - 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)
nullpublic 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)
ExtensionPointbindExtensions in class ExtensionPointCopyright © 2009–2017. All rights reserved.