java.lang.Object
com.dghda.kent.SimpleProvider
- All Implemented Interfaces:
- com.dghda.module.ModuleProvider
- public class SimpleProvider
- extends java.lang.Object
- implements com.dghda.module.ModuleProvider
A class which loads modules from classes specified in a config file.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SIMPLE_PROVIDER_CONFIG_FILE_PROPERTY
public static final java.lang.String SIMPLE_PROVIDER_CONFIG_FILE_PROPERTY
- See Also:
- Constant Field Values
DEFAULT_SIMPLE_PROVIDER_CONFIG_FILE
public static final java.lang.String DEFAULT_SIMPLE_PROVIDER_CONFIG_FILE
- See Also:
- Constant Field Values
m_Engine
private ReportEngine m_Engine
m_Modules
private java.util.TreeMap m_Modules
CONSTRUCTOR_ARG_TYPES
private static final java.lang.Class[] CONSTRUCTOR_ARG_TYPES
SimpleProvider
public SimpleProvider(ReportEngine engine)
- Create a new simple provider for the given report engine.
getModuleIterator
public java.util.Iterator getModuleIterator()
- An iterator over all modules provided.
The iterator returns instances of the Module interface.
- Specified by:
getModuleIterator in interface com.dghda.module.ModuleProvider
getModule
public com.dghda.module.Module getModule(java.lang.String id)
- Returns the module instance with the given ID.
- Specified by:
getModule in interface com.dghda.module.ModuleProvider
readConfig
protected void readConfig(java.lang.String file,
java.io.InputStream input)
throws java.io.IOException
- Reads module classes from the given configuration file.
The configuration file consists of comments (lines starting with a #), and module classes.
Specified classes are loaded and instantiated, if possible.