public class VFSLibSettings
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
LOG_PREFIX
Prefix used for the log messages created by this module.
|
static java.lang.String |
MSG_PREFIX
Prefix used for the log messages like "VFSLIB-0001".
|
protected static VFSLibSettings |
sharedInstance
Shared
VFSLibSettings instance. |
protected static VFSFileSystemManager |
vfsManagerNetwork
Shared
FileSystemManager instance holding the network connections. |
| Constructor and Description |
|---|
VFSLibSettings()
Constructor method.
|
| Modifier and Type | Method and Description |
|---|---|
void |
check()
Performs some simple tests for the caches and configurations and creates log messages.
|
static int |
extractLocalization(java.lang.Object target)
Searches for localization patterns and reads the object texts into the configuration.
|
com.lf.commons.lang.DeployProps |
getDeployProps()
Gets the global version information.
|
static java.lang.String |
getEnglishMessage(java.lang.String code)
Convenience method to get a localized official message for the user.
|
static java.lang.String |
getEnglishText(java.lang.Class clazz,
java.lang.String variable)
Convenience method to get the original (English) text.
|
static java.lang.String |
getEnglishText(java.lang.Class clazz,
java.lang.String variable,
java.lang.String[] regex,
java.lang.String[] replacement)
Convenience method to get the original (English) text.
|
com.lf.commons.i18n.I18NConfiguration |
getEnglishTexts()
Provides the English texts for the GUI (labels, tooltips etc.).
|
java.lang.String |
getI18NBase()
Provides the global resource path for internationalization resources.
|
com.lf.commons.i18n.I18NConfiguration |
getI18NTexts()
Provides the global localized texts for the user.
|
java.util.logging.Logger |
getLogger()
Gets the global logging instance.
|
com.lf.commons.i18n.Locale |
getLogLocale()
Gets the global locale used for logging.
|
static VFSFileSystemManager |
getManagerNetwork()
Get a shared instance of the Commons
FileSystemManager holding the network connections. |
com.lf.commons.msg.MessageCodes |
getMessageCodes()
Provides the global message codes handlers.
|
static VFSLibSettings |
getSharedInstance()
Convenience method to get a shared instance.
|
java.util.Vector<com.lf.commons.i18n.Locale> |
getSupportedLocales(boolean synonyms)
Returns the locales currently supported by the package.
|
com.lf.commons.i18n.Locale |
getUserLocale()
Gets the global user locale.
|
static java.lang.String |
getUserMessage(java.lang.String code)
Convenience method to get a localized official message for the user.
|
static java.lang.String |
getUserMessage(java.lang.String code,
boolean prefix)
Convenience method to get a localized official message for the user.
|
static java.lang.String |
getUserMessage(java.lang.String code,
java.lang.String[] regex,
java.lang.String[] replacement,
boolean prefix)
Convenience method to log a localized official message.
|
static java.lang.String |
getUserText(java.lang.Class clazz,
java.lang.String variable)
Convenience method to get a localized text for the user.
|
static java.lang.String |
getUserText(java.lang.Class clazz,
java.lang.String variable,
java.lang.String[] regex,
java.lang.String[] replacement)
Convenience method to get a localized text for the user.
|
static void |
localize(java.lang.Object target,
java.lang.Class targetclazz)
Provides the info whether to enable object localization or not.
|
static void |
log(java.util.logging.Level level,
java.lang.String message)
Convenience method to log a message.
|
static void |
logMessage(java.util.logging.Level level,
java.lang.String message)
Convenience method to log a message.
|
static void |
logMessage(java.lang.String code,
java.util.logging.Level level)
Convenience method to log a localized official message.
|
static void |
logMessage(java.lang.String code,
java.util.logging.Level level,
java.lang.String[] regex,
java.lang.String[] replacement)
Convenience method to log a localized official message.
|
static void |
logMessage(java.lang.String code,
java.util.logging.Level level,
java.lang.String regex,
java.lang.String replacement)
Convenience method to log a localized official message.
|
static void |
main(java.lang.String[] arg)
This may be used especially for debugging purposes.
|
void |
setLogger(java.util.logging.Logger logger)
Sets the global logging instance.
|
void |
setUserLocale(com.lf.commons.i18n.Locale locale)
Sets the global user locale.
|
protected static VFSLibSettings sharedInstance
VFSLibSettings instance.protected static VFSFileSystemManager vfsManagerNetwork
FileSystemManager instance holding the network connections.public static final java.lang.String MSG_PREFIX
public static final java.lang.String LOG_PREFIX
public static VFSFileSystemManager getManagerNetwork()
FileSystemManager holding the network connections.
Here, the connections are managed while the global VFSFileSystemManager (which can
be accessed using VFSUtils.getManager()) does not.
public void check()
public java.lang.String getI18NBase()
public com.lf.commons.i18n.I18NConfiguration getI18NTexts()
public com.lf.commons.i18n.I18NConfiguration getEnglishTexts()
public static void localize(java.lang.Object target,
java.lang.Class targetclazz)
target - The target object to be localizedtargetclazz - The target clazz, maybe a superclasspublic static int extractLocalization(java.lang.Object target)
target - The target object to be localizedpublic com.lf.commons.msg.MessageCodes getMessageCodes()
public java.util.logging.Logger getLogger()
public void setLogger(java.util.logging.Logger logger)
logger - Logging instancejava.lang.NullPointerException - Error indicationpublic com.lf.commons.i18n.Locale getUserLocale()
public void setUserLocale(com.lf.commons.i18n.Locale locale)
throws java.lang.IllegalArgumentException
locale - Locale instancejava.lang.IllegalArgumentException - Error indicationpublic java.util.Vector<com.lf.commons.i18n.Locale> getSupportedLocales(boolean synonyms)
synonyms - Also add the ISO 639-1/2 synonyms like "deu_DE" for "ger_DE"?public com.lf.commons.i18n.Locale getLogLocale()
public com.lf.commons.lang.DeployProps getDeployProps()
public static VFSLibSettings getSharedInstance()
public static void log(java.util.logging.Level level,
java.lang.String message)
level - The log levelmessage - The log messagepublic static void logMessage(java.util.logging.Level level,
java.lang.String message)
level - The log levelmessage - The log messagepublic static void logMessage(java.lang.String code,
java.util.logging.Level level)
code - The log message id like "VFSLIB-0006"level - The log levelpublic static void logMessage(java.lang.String code,
java.util.logging.Level level,
java.lang.String regex,
java.lang.String replacement)
code - The log message id like "VFSLIB-0006"level - The log levelregex - The regular expressionreplacement - The replacement stringpublic static void logMessage(java.lang.String code,
java.util.logging.Level level,
java.lang.String[] regex,
java.lang.String[] replacement)
code - The log message id like "VFSLIB-0006"level - The log levelregex - The regular expressionsreplacement - The replacement stringspublic static java.lang.String getUserMessage(java.lang.String code)
code - The message code of interest, don't pass null valuesnull if code does not existpublic static java.lang.String getEnglishMessage(java.lang.String code)
code - The message code of interest, don't pass null valuesnull if code does not existpublic static java.lang.String getUserMessage(java.lang.String code,
boolean prefix)
code - The message code of interest, don't pass null valuesprefix - Prepend the prefix?null if code does not existpublic static java.lang.String getUserMessage(java.lang.String code,
java.lang.String[] regex,
java.lang.String[] replacement,
boolean prefix)
code - The log message id like "VFSLIB-0006"regex - The regular expressionreplacement - The replacement stringprefix - Prepend the prefix?null if code does not existpublic static java.lang.String getUserText(java.lang.Class clazz,
java.lang.String variable)
clazz - The class for getting the class prefixvariable - The variable without class prefix, don't pass null valuespublic static java.lang.String getEnglishText(java.lang.Class clazz,
java.lang.String variable)
clazz - The class for getting the class prefixvariable - The variable without class prefix, don't pass null valuesnull if variable does not existpublic static java.lang.String getEnglishText(java.lang.Class clazz,
java.lang.String variable,
java.lang.String[] regex,
java.lang.String[] replacement)
clazz - The class for getting the class prefixvariable - The variable without class prefix, don't pass null valuesregex - The regular expressionreplacement - The replacement stringpublic static java.lang.String getUserText(java.lang.Class clazz,
java.lang.String variable,
java.lang.String[] regex,
java.lang.String[] replacement)
clazz - The class for getting the class prefixvariable - The variable without class prefix, don't pass null valuesregex - The regular expressionreplacement - The replacement stringpublic static void main(java.lang.String[] arg)
throws java.lang.Exception
arg - Array of String objects with console paramsjava.lang.Exception - Error indicationCopyright © 2005-2013 Leisenfels UG. All rights reserved.