Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.dghda.kent
Class SimpleProvider  view SimpleProvider download SimpleProvider.java

java.lang.Object
  extended bycom.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.


Field Summary
private static java.lang.Class[] CONSTRUCTOR_ARG_TYPES
           
static java.lang.String DEFAULT_SIMPLE_PROVIDER_CONFIG_FILE
           
private  ReportEngine m_Engine
           
private  java.util.TreeMap m_Modules
           
static java.lang.String SIMPLE_PROVIDER_CONFIG_FILE_PROPERTY
           
 
Constructor Summary
SimpleProvider(ReportEngine engine)
          Create a new simple provider for the given report engine.
 
Method Summary
 com.dghda.module.Module getModule(java.lang.String id)
          Returns the module instance with the given ID.
 java.util.Iterator getModuleIterator()
          An iterator over all modules provided.
protected  void readConfig(java.lang.String file, java.io.InputStream input)
          Reads module classes from the given configuration file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

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
Constructor Detail

SimpleProvider

public SimpleProvider(ReportEngine engine)
Create a new simple provider for the given report engine.

Method Detail

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.