|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.cmu.sphinx.util.props.ConfigurationManagerUtils
public final class ConfigurationManagerUtils
Some static utitity methods which ease the handling of system configurations.
Field Summary | |
---|---|
static java.lang.String |
CM_FILE_SUFFIX
The default file suffix of configuration files. |
static java.lang.String |
GLOBAL_COMMON_LOGLEVEL
A common property (used by all components) that sets the log level for the component. |
Method Summary | |
---|---|
static void |
configureLogger(ConfigurationManager cm)
Configure the logger |
static void |
configureLogger(java.util.logging.Logger logger)
Configures a logger to use the sphinx4-log-formatter. |
static void |
dumpPropStructure(ConfigurationManager cm)
|
static void |
editConfig(ConfigurationManager cm,
java.lang.String name)
|
static java.util.Map<java.lang.String,java.lang.String> |
fixDuplicateNames(ConfigurationManager baseCM,
ConfigurationManager subCM)
This method will automatically rename all components of subCM for which there is component named the
same in the baseCM . |
static java.lang.String |
getLogPrefix(ConfigurationManager cm)
|
static java.util.Collection<java.lang.String> |
getNonInstaniatedComps(ConfigurationManager cm)
Returns the not yet instantiated components registered to this configuration manager. |
static ConfigurationManager |
getPropertyManager(PropertySheet ps)
Why do we need this method? |
static java.net.URL |
getResource(java.lang.String name,
PropertySheet ps)
Gets a resource associated with the given parameter name given an property sheet. |
static java.net.URL |
getURL(java.io.File file)
|
static boolean |
isDerivedClass(java.lang.Class aClass,
java.lang.Class possibleParent)
|
static boolean |
isImplementingInterface(java.lang.Class aClass,
java.lang.Class interfaceClass)
|
static boolean |
isSubClass(java.lang.Class aClass,
java.lang.Class possibleSuperclass)
|
static java.util.Map<java.lang.String,java.util.List<PropertySheet>> |
listAllsPropNames(ConfigurationManager cm)
Returns a map of all component-properties of this config-manager (including their associeted property-sheets. |
static void |
save(ConfigurationManager cm,
java.io.File cmLocation)
|
static void |
setProperty(ConfigurationManager cm,
java.lang.String propName,
java.lang.String propValue)
Attempts to set the value of an arbitrary component-property. |
static void |
showConfig(ConfigurationManager cm)
Shows the current configuration |
static void |
showConfig(ConfigurationManager cm,
java.lang.String name)
Show the configuration for the compnent with the given name |
static java.lang.String |
stripGlobalSymbol(java.lang.String symbol)
Strips the ${ and } off of a global symbol of the form ${symbol}. |
static java.lang.String |
toXML(ConfigurationManager cm)
converts a configuration manager instance into a xml-string . |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String GLOBAL_COMMON_LOGLEVEL
public static final java.lang.String CM_FILE_SUFFIX
Method Detail |
---|
public static java.lang.String stripGlobalSymbol(java.lang.String symbol)
symbol
- the symbol to strip
public static void editConfig(ConfigurationManager cm, java.lang.String name)
public static java.lang.String getLogPrefix(ConfigurationManager cm)
public static void configureLogger(ConfigurationManager cm)
public static void configureLogger(java.util.logging.Logger logger)
public static java.util.Map<java.lang.String,java.lang.String> fixDuplicateNames(ConfigurationManager baseCM, ConfigurationManager subCM)
subCM
for which there is component named the
same in the baseCM
.
Note: This is ie. required when merging two system configurations into one.
public static java.lang.String toXML(ConfigurationManager cm)
public static void save(ConfigurationManager cm, java.io.File cmLocation)
public static void showConfig(ConfigurationManager cm)
public static void showConfig(ConfigurationManager cm, java.lang.String name)
name
- the component namepublic static java.net.URL getResource(java.lang.String name, PropertySheet ps) throws PropertyException
name
- the parameter nameps
- The property sheet which contains the property
PropertyException
- if the resource cannot be foundpublic static boolean isDerivedClass(java.lang.Class aClass, java.lang.Class possibleParent)
true
if aClass
is either equal to poosibleParent
, a subclass of
it, or implements it if possibleParent
is an interface.public static boolean isImplementingInterface(java.lang.Class aClass, java.lang.Class interfaceClass)
public static boolean isSubClass(java.lang.Class aClass, java.lang.Class possibleSuperclass)
public static ConfigurationManager getPropertyManager(PropertySheet ps)
PropertySheet
-API. In some circumstances it is nevertheless required to get access to the managing
ConfigurationManager
.
public static java.util.Map<java.lang.String,java.util.List<PropertySheet>> listAllsPropNames(ConfigurationManager cm)
public static void dumpPropStructure(ConfigurationManager cm)
public static void setProperty(ConfigurationManager cm, java.lang.String propName, java.lang.String propValue)
ConfiguratioManager
an extended syntax (componentName->propName) can be used to acess the
property.
public static java.net.URL getURL(java.io.File file)
public static java.util.Collection<java.lang.String> getNonInstaniatedComps(ConfigurationManager cm)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |