Package org.opt4j.config
Class ModuleRegister
- java.lang.Object
-
- org.opt4j.config.ModuleRegister
-
public class ModuleRegister extends Object implements Iterable<Class<? extends com.google.inject.Module>>
TheModuleRegistercontains all found modules for theConfigurator.
-
-
Field Summary
Fields Modifier and Type Field Description protected ModuleListfinderprotected booleanisInitprotected Map<Class<? extends com.google.inject.Module>,PropertyModule>mapprotected Set<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 PropertyModuleget(Class<? extends com.google.inject.Module> clazz)Returns thePropertyModuleof the specified class and creates a new instance if necessary.Iterator<Class<? extends com.google.inject.Module>>iterator()intsize()Returns the number of found modules.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Field Detail
-
map
protected final Map<Class<? extends com.google.inject.Module>,PropertyModule> map
-
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
-
size
public int size()
Returns the number of found modules.- Returns:
- the number of found modules
- See Also:
HashSet.size()
-
get
public PropertyModule get(Class<? extends com.google.inject.Module> clazz)
Returns thePropertyModuleof the specified class and creates a new instance if necessary.- Parameters:
clazz- the class of the module- Returns:
- the property module
-
-