public class ModuleRegistry extends Destroyable
| Modifier and Type | Class and Description |
|---|---|
static class |
ModuleRegistry.Entry
Represents the registry entry DTO.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
addGhostModule(Class<? extends Module> moduleClass,
Module module,
ModuleInformation information)
Adds a "ghost" module which has an entry but is not added to the loaded modules list
and thus will only be visible to the injector.
|
protected void |
addModule(Class<? extends Module> moduleClass,
ModuleRegistry.Entry entry,
boolean ghost)
Adds a module to the registry.
|
protected ModuleRegistry.Entry |
createEntry(Class<? extends Module> moduleClass,
ModuleInformation information)
Creates a new registry entry for the given module.
|
protected void |
destroy()
Attempts to "destroy" the object by clearing memory (e.g.
|
protected ModuleRegistry.Entry |
getEntry(Class<? extends Module> moduleClass)
Gets the registry entry for the given module.
|
ModuleInformation |
getInformation(Class<? extends Module> moduleClass)
Gets the module information for the given module.
|
<M extends Module> |
getModule(Class<M> moduleClass)
Gets a module by its class.
|
Collection<Module> |
getModules()
Gets a collection of all currently registered modules.
|
Collection<Module> |
getModules(ModuleState state)
Gets a collection of all registered modules with the given state.
|
protected Map<Class<? extends Module>,ModuleRegistry.Entry> |
getRegistry()
Returns the internal registry.
|
public <M extends Module> M getModule(Class<M> moduleClass)
M - The module typemoduleClass - The class of the modulepublic ModuleInformation getInformation(Class<? extends Module> moduleClass)
moduleClass - The class of the modulepublic Collection<Module> getModules()
public Collection<Module> getModules(ModuleState state)
state - The state to check againstprotected void addGhostModule(Class<? extends Module> moduleClass, Module module, ModuleInformation information)
moduleClass - The class of the module we're implementingmodule - The implementationinformation - The information instanceprotected void addModule(Class<? extends Module> moduleClass, ModuleRegistry.Entry entry, boolean ghost)
moduleClass - The class of the module we're implementingentry - The registry entryghost - False if it should be added to collection, true if it should be hiddenprotected ModuleRegistry.Entry createEntry(Class<? extends Module> moduleClass, ModuleInformation information)
moduleClass - The class of the module we're implementinginformation - The module's informationprotected ModuleRegistry.Entry getEntry(Class<? extends Module> moduleClass)
moduleClass - The class of the module we're implementingprotected void destroy()
Destroyabledestroy in class Destroyableprotected Map<Class<? extends Module>,ModuleRegistry.Entry> getRegistry()
Copyright © 2014–2015 MountainBlade. All rights reserved.