public final class ExtensionRegistry extends Object
| Modifier and Type | Field and Description |
|---|---|
static ExtensionRegistry |
INSTANCE
The singleton instance.
|
| Modifier and Type | Method and Description |
|---|---|
<T> T |
get(String id,
Class<T> clazz)
Returns the requested extension point.
|
<T> T |
get(String id,
Class<T> clazz,
T defaultInstance,
boolean shouldSetDefault)
Returns the requested extension point.
|
void |
remove(String id)
Remove the extension with the given ID.
|
<T> void |
set(String id,
T t)
Set the extension.
|
public static final ExtensionRegistry INSTANCE
public <T> T get(String id, Class<T> clazz, T defaultInstance, boolean shouldSetDefault)
T - the expected typeid - the ID of the extension point to be returnedclazz - the expected typedefaultInstance - a default instance to be returned in case no extension point has been foundshouldSetDefault - whether the default instance should be registeredpublic <T> T get(String id, Class<T> clazz)
T - the expected typeid - the ID of the extension point to be returnedclazz - the expected typepublic <T> void set(String id, T t)
T - the type of the extension to be setid - the ID of the extension point to be returnedt - the extension to be setpublic void remove(String id)
id - the ID of the extension to be removedCopyright © 2017. All rights reserved.