public class DefaultReplacementsModule extends AbstractModule implements ReplacementsModule
| Modifier and Type | Class and Description |
|---|---|
static class |
DefaultReplacementsModule.RegexReplacement |
static interface |
DefaultReplacementsModule.Replacement |
static class |
DefaultReplacementsModule.StringReplacement |
| Modifier and Type | Field and Description |
|---|---|
protected java.util.HashMap<java.lang.String,DefaultReplacementsModule.Replacement> |
replacements |
autoStart, isInitialized, isRunning, logging, loggingModule, moduleManager| Constructor and Description |
|---|
DefaultReplacementsModule() |
| Modifier and Type | Method and Description |
|---|---|
void |
init(ModuleManager manager,
java.util.HashMap<java.lang.String,java.lang.Object> settings)
Initialises the module.
|
java.lang.String |
replaceValue(java.lang.String value,
java.util.HashMap<java.lang.String,java.lang.Object> context)
Replace the values in the given string using the given context.
|
getDependencies, isInitialized, isRunning, requireLogging, start, stop, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetDependencies, isInitialized, isRunning, start, stopprotected java.util.HashMap<java.lang.String,DefaultReplacementsModule.Replacement> replacements
public void init(ModuleManager manager, java.util.HashMap<java.lang.String,java.lang.Object> settings) throws ModuleException
ModuleInitialises the module. After constructor, this is the first method called in the life cycle of a module. It should not perform anything time consuming or anything with notable outside side effects. It should only read the parameters and initialise the module so that it can later be started. Note that a module being initialised doesn't mean that it necessarily will ever be started.
A ModuleException may be thrown if something vital is missing from the parameters or they are not sensible. In some cases you may not want to throw an exception even if vital initialisation information is missing. If, for example, it is possible that the module is initialised in some other way between the init and the start method calls. A ModuleException may also be thrown at the start method if the module is still not initialised.
init in interface Moduleinit in class AbstractModulemanager - The module manager handling this module. You may keep a
reference to it if needed.ModuleExceptionpublic java.lang.String replaceValue(java.lang.String value,
java.util.HashMap<java.lang.String,java.lang.Object> context)
ReplacementsModulereplaceValue in interface ReplacementsModulevalue - The string in which replacements are to be done.context - A context used in the replacements.Copyright 2004-2015 Wandora Team