public class ModuleRegistry extends Object
Modifier and Type | Method and Description |
---|---|
static List<MaryModule> |
getAllModules()
Provide a list containing all MaryModules instances.
|
static MaryModule |
getModule(Class<?> moduleClass)
Find an active module by its class.
|
static List<MaryModule> |
getPreferredModulesForInputType(MaryDataType wanted_input_type)
Provide a list containing preferred modules for the specified input type
|
static boolean |
getRegistrationComplete()
Determine whether or not the registration is complete.
|
static MaryModule |
instantiateModule(String moduleInitInfo)
From the given module init info, instantiate a new mary module.
|
static LinkedList<MaryModule> |
modulesRequiredForProcessing(MaryDataType sourceType,
MaryDataType targetType,
Locale locale)
A method for determining the list of modules required to transform the given source data type into the requested target
data type.
|
static LinkedList<MaryModule> |
modulesRequiredForProcessing(MaryDataType sourceType,
MaryDataType targetType,
Locale locale,
Voice voice)
A method for determining the list of modules required to transform the given source data type into the requested target
data type.
|
static void |
registerModule(MaryModule module,
Locale locale,
Voice voice)
Register a MaryModule as an appropriate module to process the given combination of MaryDataType for the input data, locale
of the input data, and voice requested for processing.
|
static void |
setRegistrationComplete()
Indicate that the registration is now complete.
|
public static MaryModule instantiateModule(String moduleInitInfo) throws MaryConfigurationException
moduleInitInfo
- a string description of the module to instantiate. The moduleInitInfo is expected to have one of the following
forms:
MaryConfigurationException
- if the module cannot be instantiatedpublic static void registerModule(MaryModule module, Locale locale, Voice voice) throws IllegalStateException
module
- the module to add to the registry, under its input type and the given locale and voice.locale
- the locale (language or language-COUNTRY) of the input data; can be null to signal that the module is
locale-independent.voice
- a voice for which this module is suited. Can be null to indicate that the module is not specific to any voice.IllegalStateException
- if called after registration is complete.public static boolean getRegistrationComplete()
are possible; when the registration is complete, calls to the other methods
are possible.
public static void setRegistrationComplete() throws IllegalStateException
IllegalStateException
- if called when registration was already completed before.public static List<MaryModule> getPreferredModulesForInputType(MaryDataType wanted_input_type)
wanted_input_type
- the specified input typepublic static List<MaryModule> getAllModules()
IllegalStateException
- if called while registration is not yet complete.public static MaryModule getModule(Class<?> moduleClass)
moduleClass
- moduleClassIllegalStateException
- if called while registration is not yet complete.public static LinkedList<MaryModule> modulesRequiredForProcessing(MaryDataType sourceType, MaryDataType targetType, Locale locale)
sourceType
- sourceTypetargetType
- targetTypelocale
- localeIllegalStateException
- if called while registration is not yet complete.NullPointerException
- if source data type, target data type or locale is null.public static LinkedList<MaryModule> modulesRequiredForProcessing(MaryDataType sourceType, MaryDataType targetType, Locale locale, Voice voice)
sourceType
- sourceTypetargetType
- target typelocale
- localevoice
- voiceIllegalStateException
- if called while registration is not yet complete.NullPointerException
- if source data type, target data type or locale is null.Copyright © 2000–2016 DFKI GmbH. All rights reserved.