|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Any class implementing this interface may appear in an initialization script read in by the Script class. A class that does this should construct its own configuration object and initialize the parameters with the appropriate types and default values. This object should be returned by the getConfiguration() method. This configuration object will then be filled out by the Script class with whatever values appear in the initialization script.
The following syntax may then be used in an initialization script:public class MyInitializer implements Initializer { Configuration m_config = new Configuration(); public MyInitializer() throws InitializationException { m_config.initParameter("stringParam", "This is a usage string.", String.class,"This is a string."); m_config.initParameter("intParam", "Please enter a value for the intParam.") m_config.initParameter("listParam", "Should be a list.", java.util.List.class, new ArrayList()); } public Configuration getConfiguration() { return m_config; } public void startup() { // Run startup code here. } public void shutdown() { // Run shutdown code here. } }
init MyInitializer { stringParam = "foo"; intParam = 3; listParam = { "foo", "bar", "baz" }; }
Field Summary | |
static String |
versionId
|
Method Summary | |
Configuration |
getConfiguration()
Returns the configuration object used by this initializer. |
void |
shutdown()
Called on shutdown. |
void |
startup()
Called on startup. |
Field Detail |
public static final String versionId
Method Detail |
public Configuration getConfiguration()
public void startup() throws InitializationException
InitializationException
public void shutdown() throws InitializationException
InitializationException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |