Package org.opt4j.core.config
Class ModuleRegister
- java.lang.Object
-
- org.opt4j.core.config.ModuleRegister
-
- All Implemented Interfaces:
java.lang.Iterable<java.lang.Class<? extends com.google.inject.Module>>
public class ModuleRegister extends java.lang.Object implements java.lang.Iterable<java.lang.Class<? extends com.google.inject.Module>>
TheModuleRegister
contains all found modules for theConfigurator
.
-
-
Field Summary
Fields Modifier and Type Field Description protected ModuleList
finder
protected boolean
isInit
protected java.util.Map<java.lang.Class<? extends com.google.inject.Module>,PropertyModule>
map
protected java.util.Set<java.lang.Class<? extends com.google.inject.Module>>
set
-
Constructor Summary
Constructors Constructor Description ModuleRegister(ModuleList finder)
Constructs and populates theModuleRegister
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PropertyModule
get(java.lang.Class<? extends com.google.inject.Module> clazz)
Returns thePropertyModule
of the specified class and creates a new instance if necessary.java.util.Iterator<java.lang.Class<? extends com.google.inject.Module>>
iterator()
int
size()
Returns the number of found modules.
-
-
-
Field Detail
-
map
protected final java.util.Map<java.lang.Class<? extends com.google.inject.Module>,PropertyModule> map
-
set
protected final java.util.Set<java.lang.Class<? extends com.google.inject.Module>> set
-
finder
protected final ModuleList finder
-
isInit
protected boolean isInit
-
-
Constructor Detail
-
ModuleRegister
@Inject public ModuleRegister(ModuleList finder)
Constructs and populates theModuleRegister
.- Parameters:
finder
- the module finder to be used
-
-
Method Detail
-
iterator
public java.util.Iterator<java.lang.Class<? extends com.google.inject.Module>> iterator()
- Specified by:
iterator
in interfacejava.lang.Iterable<java.lang.Class<? extends com.google.inject.Module>>
-
size
public int size()
Returns the number of found modules.- Returns:
- the number of found modules
- See Also:
HashSet.size()
-
get
public PropertyModule get(java.lang.Class<? extends com.google.inject.Module> clazz)
Returns thePropertyModule
of the specified class and creates a new instance if necessary. If the property module can not be created,null
is returned.- Parameters:
clazz
- the class of the module- Returns:
- the property module or null
-
-