public class AdapterRegistry extends Object implements ExtensionPoint<Adapter>
| Modifier and Type | Method and Description |
|---|---|
<Input,Output> |
adapt(Input input,
Class<Output> outputType)
Find an adapter that can adapt the given input into the given output type, and adapt it
or return null if no available adapter can be found.
|
void |
addPlugin(Adapter plugin)
Register a plugin (called at application startup).
|
void |
allPluginsLoaded()
Signal that application has been fully loaded and no more plug-ins will be added.
|
boolean |
canAdapt(Object input,
Class<?> outputType)
Return true if an adapter can be found to adapt the given input into the given output type.
|
<Input,Output> |
findAdapter(Object in,
Class<Input> input,
Class<Output> output)
Search for an adapter.
|
static AdapterRegistry |
get()
Returns the instance of the adapter registry.
|
Class<Adapter> |
getPluginClass()
Class of plugin.
|
Collection<Adapter> |
getPlugins()
Return the list of registered plugins.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitprintInfopublic static AdapterRegistry get()
public void addPlugin(Adapter plugin)
ExtensionPointaddPlugin in interface ExtensionPoint<Adapter>public void allPluginsLoaded()
ExtensionPointallPluginsLoaded in interface ExtensionPoint<Adapter>public Collection<Adapter> getPlugins()
ExtensionPointgetPlugins in interface ExtensionPoint<Adapter>public Class<Adapter> getPluginClass()
ExtensionPointgetPluginClass in interface ExtensionPoint<Adapter>public <Input,Output> Output adapt(Input input,
Class<Output> outputType)
throws AdapterException
AdapterExceptionpublic boolean canAdapt(Object input, Class<?> outputType)
Copyright © 2019. All rights reserved.