public final class L10n extends java.lang.Object implements L10nPackProviderI
Modifier and Type | Class and Description |
---|---|
static class |
L10n.UnresolvedMessage |
Modifier and Type | Field and Description |
---|---|
static java.util.regex.Pattern |
l10nTagPattern |
static java.lang.String |
PACK_SEPARATOR |
static java.util.regex.Pattern |
validBundleNamePattern |
static java.util.regex.Pattern |
validPackagePattern |
static java.lang.String |
validResourceKeyChars |
static java.util.regex.Pattern |
validResourceKeyPattern |
Modifier and Type | Method and Description |
---|---|
static void |
addLocaleChangeListener(L10nLocaleChangeListenerI _lcl) |
static void |
addPathCompilerForClass(java.lang.Class clazz,
L10nPathCompilerI comp)
Classes will create singleton instances of their special version of
L10nPathCompilerI and add them with this method to the L10n list.
|
static void |
addPreloadL10nCacheFinishedListener(PreloadL10nCacheFinishedListenerI l) |
static void |
appendPackProvider(L10nPackProviderI p) |
static electric.xml.Document |
applyL10n(electric.xml.Document _doc,
java.lang.Object[] _path) |
static electric.xml.Document |
applyL10n(electric.xml.Document _doc,
java.lang.Object[] _path,
java.lang.String _localeName) |
static void |
applyL10n(electric.xml.Element _el,
java.lang.Object[] _path) |
static void |
applyL10n(electric.xml.Element _el,
java.lang.Object[] _path,
java.lang.String _localeName) |
static java.lang.String |
applyL10n(java.lang.String in,
java.lang.Object[] path)
Replaces $R{...} in given String by appropriate texts and returns the
result.
|
static java.lang.String |
applyL10n(java.lang.String in,
java.lang.Object[] path,
java.lang.String localeName) |
static java.lang.String |
applyL10nLocale(java.lang.String in,
java.lang.Object[] path,
java.util.Locale locale) |
static java.lang.String |
canonifyPackageName(java.lang.String s)
Removes '$' "sub"class parts from s.
|
static java.lang.String[] |
compilePath(java.lang.Object[] participants)
Compiles and returns a list of L10nBundle names.
|
static void |
firePathCompilersChanged() |
static void |
flushCache() |
static void |
flushCache(java.lang.String bundle) |
static void |
flushCache(java.lang.String[] bundles) |
static java.lang.String |
formatDate(java.util.Date d)
usage with locale not recommended as they are not being cached, which leads to poor performance. the locale can instead be stored in the pattern-string
|
static java.lang.String |
formatDate(java.util.Date d,
java.lang.String pattern) |
static java.lang.String |
formatDate(java.util.Date d,
java.lang.String pattern,
java.util.Locale _locale) |
static java.lang.String |
formatDate(java.util.Date d,
java.lang.String pattern,
java.util.Locale _locale,
java.util.TimeZone timeZone) |
static java.lang.String |
formatDateNT(java.util.Date d)
null safe version of formatDate with fallback if date is null
|
static java.lang.String |
formatDateNT(java.util.Date d,
java.lang.String pattern) |
static java.lang.String |
formatDateNT(java.util.Date d,
java.lang.String pattern,
java.util.Locale locale) |
static java.lang.String |
formatDateNT(java.util.Date d,
java.lang.String pattern,
java.util.Locale locale,
java.lang.String fallback) |
static java.lang.String |
formatDateNT(java.util.Date d,
java.lang.String pattern,
java.lang.String fallback)
null safe version of formatDate with fallback if date is null
|
static java.lang.String |
formatDecimal(java.lang.Number n) |
static java.lang.String |
formatDecimal(java.lang.Number n,
java.lang.String pattern) |
static java.lang.String |
formatDecimal(java.lang.Number n,
java.lang.String pattern,
java.util.Locale _locale) |
static java.lang.String |
formatDecimalNT(java.lang.Number n)
null safe version of formatDecimal with fallback if number is null
|
static java.lang.String |
formatDecimalNT(java.lang.Number n,
java.lang.String pattern) |
static java.lang.String |
formatDecimalNT(java.lang.Number n,
java.lang.String pattern,
java.util.Locale locale) |
static java.lang.String |
formatDecimalNT(java.lang.Number n,
java.lang.String pattern,
java.util.Locale locale,
java.lang.String fallback) |
static java.lang.String |
formatDecimalNT(java.lang.Number n,
java.lang.String pattern,
java.lang.String fallback)
null safe version of formatDecimal with fallback if number is null
|
static java.lang.String |
formatDuration(javax.xml.datatype.Duration _dur) |
static java.lang.String |
formatDuration(javax.xml.datatype.Duration _dur,
java.lang.String _pattern) |
static java.lang.String |
formatDuration(javax.xml.datatype.Duration _dur,
java.lang.String _pattern,
java.util.Locale _locale) |
static java.lang.String |
formatISO8601(java.util.Date date)
Returns the given Date in an ISO8601:2019 conformant String.
|
static java.lang.String |
formatISO8601(java.util.Date date,
boolean withLocalTimeZone) |
static java.lang.String |
formatISO8601NT(java.util.Date date)
Not throwing version of
#formatISO8601Date(Date, boolean) . |
static java.lang.String |
formatISO8601NT(java.util.Date date,
java.lang.String fallback) |
static java.lang.String |
formatISO8601NT(java.util.Date date,
java.lang.String fallback,
boolean withLocalTimeZone) |
static java.lang.String |
formatISODate(java.util.Date d)
Formats the given Date in ISO8601 like format, with the 'T' replaced by a space.
|
static java.lang.String |
formatISODateNT(java.util.Date d)
null safe version of formatISODate with fallback if date is null
|
static java.lang.String |
formatISODateNT(java.util.Date d,
java.lang.String fallback) |
static java.lang.String |
formatTimespan(java.lang.Number _ts) |
static java.lang.String |
formatTimespan(java.lang.Number _ts,
java.lang.String _pattern) |
static java.lang.String |
formatTimespan(java.lang.Number _ts,
java.lang.String _pattern,
java.util.Locale _locale) |
static java.lang.String[] |
getAutoPath()
Returns path compiled by using info from current StackTrace.
|
static java.lang.String[] |
getAutoPath(int _stackOffset) |
static java.text.Collator |
getCollator()
returns a Collator for the current default locale, but makes it space sensitive
|
static java.text.Collator |
getCollator(java.util.Locale l) |
static java.text.Collator |
getCollator(java.util.Locale l,
java.lang.String parms) |
static L10nCurrentLocaleProviderI |
getCurrentLocaleProvider()
Gets the locale provider for the current Thread.
|
static java.util.Locale |
getCurrentLocaleViaProvider()
Returns the current locale for the current Thread.
|
static L10nDateFormat |
getDateFormat() |
static L10nDateFormat |
getDateFormat(java.lang.String _pattern) |
static L10nDateFormat |
getDateFormat(java.lang.String _pattern,
java.util.Locale _locale) |
static L10nDateFormat |
getDateFormat(java.lang.String _pattern,
java.util.Locale _locale,
java.util.TimeZone timeZone) |
static L10nDecimalFormat |
getDecimalFormat()
Factory-Method for DecimalFormat objects, locale sensitive.
|
static L10nDecimalFormat |
getDecimalFormat(java.lang.String _pattern) |
static L10nDecimalFormat |
getDecimalFormat(java.lang.String _pattern,
java.util.Locale _locale) |
static java.util.Locale |
getDefaultLocale() |
static java.lang.String |
getDefaultLocaleName() |
static java.util.function.Supplier<java.lang.String> |
getGetCallingClassNameImplementation() |
L10nPack |
getL10nPack(java.lang.String name,
java.lang.String ln) |
L10nPack[] |
getL10nPacks(java.lang.String[] bundles,
java.lang.String ln) |
L10nPathEntry[] |
getL10nPath() |
java.lang.String |
getL10nViaString() |
static java.lang.String |
getLanguageSeperatedByDash(java.lang.String _str,
int _lang)
this method takes a String where the languages are seperated by |
it returns the _lang'th language of this string, beginning at 1
|
static java.util.Locale |
getLocaleFromString(java.lang.String s) |
static L10nPack |
getPack(java.lang.String[] path,
int index)
Loading the packs is a bit complex, because incomplete packs are possible with only
a small part of the keys inside.
|
static L10nPack |
getPack(java.lang.String[] path,
int index,
java.lang.String ln) |
static L10nTimespanFormat |
getTimespanFormat() |
static L10nTimespanFormat |
getTimespanFormat(java.lang.String pattern) |
static L10nTimespanFormat |
getTimespanFormat(java.lang.String pattern,
java.util.Locale locale) |
static java.lang.String |
getWaehrungsSymbol(java.lang.String isocode) |
L10nPack |
internalGetL10nPack(java.lang.String name,
java.lang.String ln)
Loads L10nPack from *.properties file resources via classpath and
getResourceAsStream().
|
boolean |
isOperational() |
static boolean |
isParentOf(java.util.Locale supposedParent,
java.util.Locale supposedChild) |
static java.lang.String |
msg(java.lang.String key)
Convenience frontend that automatically compiles the path by getting the
calling class from the current StackTrace.
|
static java.lang.String |
msg(java.lang.String key,
byte arg0)
Convenience frontend for
#msg(String, Object[]) . |
static java.lang.String |
msg(java.lang.String key,
int arg0)
Convenience frontend for
#msg(String, Object[]) . |
static java.lang.String |
msg(java.lang.String key,
long arg0)
Convenience frontend for
#msg(String, Object[]) . |
static java.lang.String |
msg(java.lang.String key,
java.lang.Number arg0)
Convenience frontend for
#msg(String, Object[]) . |
static java.lang.String |
msg(java.lang.String key,
java.lang.Object[] args) |
static java.lang.String |
msg(java.lang.String key,
java.lang.Object[] args,
int stackOffset) |
static java.lang.String |
msg(java.lang.String key,
java.lang.Object[] args,
java.lang.Object[] _participants) |
static java.lang.String |
msg(java.lang.String key,
java.lang.Object[] args,
java.lang.Object[] _participants,
boolean returnKeyWhenNotFound) |
static java.lang.String |
msg(java.lang.String key,
java.lang.Object[] args,
java.lang.Object[] _participants,
boolean returnKeyWhenNotFound,
java.util.Locale locale) |
static java.lang.String |
msg(java.lang.String key,
java.lang.Object[] args,
java.lang.Object[] _participants,
boolean returnKeyWhenNotFound,
java.lang.String localeName) |
static java.lang.String |
msg(java.lang.String key,
java.lang.Object[] args,
java.lang.String[] path) |
static java.lang.String |
msg(java.lang.String key,
java.lang.Object[] args,
java.lang.String[] path,
boolean returnKeyWhenNotFound) |
static java.lang.String |
msg(java.lang.String key,
java.lang.Object[] args,
java.lang.String[] path,
boolean returnKeyWhenNotFound,
java.lang.String localeName) |
static java.lang.String |
msg(java.lang.String key,
java.lang.Object[] args,
java.lang.String[] path,
boolean returnKeyWhenNotFound,
java.lang.String localeName,
boolean useFallbackLocale) |
static java.lang.String |
msg(java.lang.String key,
short arg0)
Convenience frontend for
#msg(String, Object[]) . |
static java.lang.String |
msg(java.lang.String key,
java.lang.String arg0)
Convenience frontend for
#msg(String, Object[]) . |
static java.lang.String |
msg(java.lang.String key,
java.lang.String arg0,
java.lang.String arg1)
Convenience frontend for
#msg(String, Object[]) . |
static java.lang.String |
msg(java.lang.String key,
java.lang.String arg0,
java.lang.String arg1,
java.lang.String arg2)
Convenience frontend for
#msg(String, Object[]) . |
static java.lang.String |
msg(java.lang.String key,
java.lang.String arg0,
java.lang.String arg1,
java.lang.String arg2,
java.lang.String arg3)
Convenience frontend for
#msg(String, Object[]) . |
static java.lang.String |
msgNoFormat(java.lang.String key)
Convenience frontend that automatically compiles the path by getting the
calling class from the current StackTrace.
|
static java.lang.String |
msgNoFormat(java.lang.String key,
int stackOffset) |
static java.lang.String |
msgNoFormat(java.lang.String key,
java.lang.String[] path)
Gets the matching message template string for key, etc.
|
static java.lang.String |
msgNoFormat(java.lang.String key,
java.lang.String[] path,
java.lang.String localeName) |
static java.lang.String |
msgNoKey(java.lang.String key)
Convenience frontend that automatically compiles the path by getting the
calling class from the current StackTrace.
|
static java.lang.String |
msgNoKey(java.lang.String key,
java.lang.Object[] args) |
static java.lang.String |
msgNoKey(java.lang.String key,
java.lang.Object[] args,
int stackOffset) |
static java.util.Date |
parseDate(java.lang.String s)
usage with locale not recommended as they are not being cached, which leads to poor performance. the locale can instead be stored in the pattern-string
|
static java.util.Date |
parseDate(java.lang.String s,
java.lang.String pattern) |
static java.util.Date |
parseDate(java.lang.String s,
java.lang.String[] patterns)
usage with locale not recommended as they are not being cached which leads to poor performance. the locale can instead be stored in the pattern-string
|
static java.util.Date |
parseDate(java.lang.String s,
java.lang.String[] patterns,
java.util.Locale _locale) |
static java.util.Date |
parseDate(java.lang.String s,
java.lang.String[] patterns,
java.util.Locale _locale,
java.util.TimeZone timeZone) |
static java.util.Date |
parseDate(java.lang.String s,
java.lang.String pattern,
java.util.Locale _locale) |
static java.util.Date |
parseDate(java.lang.String s,
java.lang.String pattern,
java.util.Locale _locale,
java.util.TimeZone timeZone) |
static java.util.Date |
parseDateNT(java.lang.String s)
wrapper for parseDate that throws no exception. if an exception is caught, fallback is returned, which defaults to null
|
static java.util.Date |
parseDateNT(java.lang.String s,
java.lang.String pattern) |
static java.util.Date |
parseDateNT(java.lang.String s,
java.lang.String[] patterns)
wrapper for parseDate that throws no exception. if an exception is caught, fallback is returned, which defaults to null
|
static java.util.Date |
parseDateNT(java.lang.String s,
java.lang.String[] patterns,
java.util.Date fallback) |
static java.util.Date |
parseDateNT(java.lang.String s,
java.lang.String pattern,
java.util.Date fallback) |
static java.math.BigDecimal |
parseDecimal(java.lang.String s)
Method to parse a L10n formatted Number in a String to the represented BigDecimal value.
|
static java.math.BigDecimal |
parseDecimal(java.lang.String s,
java.lang.String pattern) |
static java.math.BigDecimal |
parseDecimal(java.lang.String s,
java.lang.String[] patterns) |
static java.math.BigDecimal |
parseDecimal(java.lang.String s,
java.lang.String[] patterns,
java.util.Locale _locale) |
static java.math.BigDecimal |
parseDecimal(java.lang.String s,
java.lang.String pattern,
java.util.Locale _locale) |
static java.math.BigDecimal |
parseDecimalNT(java.lang.String s)
wrapper for parseDecimal that throws no exception. if an exception is caught, fallback is returned, which defaults to null
|
static java.math.BigDecimal |
parseDecimalNT(java.lang.String s,
java.lang.String pattern) |
static java.math.BigDecimal |
parseDecimalNT(java.lang.String s,
java.lang.String[] patterns)
wrapper for parseDecimal that throws no exception. if an exception is caught, fallback is returned, which defaults to null
|
static java.math.BigDecimal |
parseDecimalNT(java.lang.String s,
java.lang.String[] patterns,
java.math.BigDecimal fallback) |
static java.math.BigDecimal |
parseDecimalNT(java.lang.String s,
java.lang.String pattern,
java.math.BigDecimal fallback) |
static javax.xml.datatype.Duration |
parseDuration(java.lang.String s) |
static java.util.Date |
parseISO8601(java.lang.String s)
Parses an ISO8601:2019 conform Datetime text, returning the parameter as Date.
|
static java.util.Date |
parseISO8601NT(java.lang.String s)
Non-throw version of
parseISO8601(String) , returning the fallback if the given String is not a valid ISO date |
static java.util.Date |
parseISO8601NT(java.lang.String s,
java.util.Date fallback) |
static java.util.Date |
parseISODate(java.lang.String s)
Parses the given parameter as a ISO8601 like date, e.g. yyyy-MM-dd'T'HH:mm:ss.SSSX or yyyy-MM-dd,
while trying to be a bit more tolerant regarding formatting errors.
|
static java.util.Date |
parseISODateNT(java.lang.String s)
wrapper for parseISODate thet throws no exception. if an exception is caught, fallback is returned, which defaults to null
|
static java.util.Date |
parseISODateNT(java.lang.String s,
java.util.Date fallback) |
static java.lang.Long |
parseTimespan(java.lang.String _str) |
static java.lang.Long |
parseTimespan(java.lang.String _str,
java.lang.String _pattern) |
static java.lang.Long |
parseTimespan(java.lang.String _str,
java.lang.String[] _patterns) |
static java.lang.Long |
parseTimespan(java.lang.String _str,
java.lang.String[] _patterns,
java.util.Locale _locale) |
static java.lang.Long |
parseTimespan(java.lang.String _str,
java.lang.String _pattern,
java.util.Locale _locale) |
static void |
preloadCache(L10nPackProviderI provider,
L10nPack[] packsToPreload,
java.lang.String ln) |
static void |
prependPackProvider(L10nPackProviderI p) |
static void |
recalcPath() |
static void |
releaseDateFormat(L10nDateFormat df) |
static void |
releaseDecimalFormat(L10nDecimalFormat df) |
static void |
releaseTimespanFormat(L10nTimespanFormat df) |
static void |
removePackProvider(L10nPackProviderI p) |
static void |
removePathCompilerForClass(java.lang.Class clazz,
L10nPathCompilerI comp)
FIXME (Currently) Not used.
|
static L10n.UnresolvedMessage |
resolveLater(java.lang.String msg,
java.lang.Object participant) |
static L10n.UnresolvedMessage |
resolveLater(java.lang.String msg,
java.lang.Object[] participants) |
static L10n.UnresolvedMessage |
resolveLater(java.lang.String msg,
java.lang.Object[] parameters,
java.lang.Object[] participants) |
static void |
setCurrentLocaleProvider(L10nCurrentLocaleProviderI p)
Sets the locale provider for the current Thread.
|
static void |
setDefaultLocale(java.util.Locale l) |
static void |
setDefaultLocaleName(java.lang.String s) |
static java.lang.String[] |
splitPath(java.lang.String _path)
Splits the given _path on '/' but ignoring '/' insided of $R{...} tags.
|
static java.lang.String |
stringToKey(java.lang.String _str)
Creates a usable L10n message key from a given String by removing spaces
and not permitted characters and if given prepending a prefix.
|
static java.lang.String |
stringToKey(java.lang.String _str,
java.lang.String _prefix) |
static L10nPack |
validPack(java.lang.String key,
java.lang.String[] path)
A valid L10nPack is where pack.getString(key)<>null
|
static L10nPack |
validPack(java.lang.String key,
java.lang.String[] path,
java.lang.String localeName) |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
prefetchL10nPacks
public static final java.util.regex.Pattern validPackagePattern
public static final java.util.regex.Pattern validBundleNamePattern
public static final java.lang.String validResourceKeyChars
public static final java.util.regex.Pattern validResourceKeyPattern
public static final java.util.regex.Pattern l10nTagPattern
public static final java.lang.String PACK_SEPARATOR
public static final java.lang.String applyL10nLocale(java.lang.String in, java.lang.Object[] path, java.util.Locale locale)
#applyL10n(String, Object[], String), with the last parameter being the LanguageTag if locale is not null
public static final java.lang.String applyL10n(java.lang.String in, java.lang.Object[] path)
in
- input String containing $R{...} parts which shall be translated using L10nBundlespath
- an object array containing the names of the L10nBundles to use for looking up the keyslocaleName
- the name of the locale to use for resolving the translated String, e.g. de, en, fr or even de_DE, fr_LU, de_LU etc.public static final java.lang.String applyL10n(java.lang.String in, java.lang.Object[] path, java.lang.String localeName)
public static final electric.xml.Document applyL10n(electric.xml.Document _doc, java.lang.Object[] _path)
public static final electric.xml.Document applyL10n(electric.xml.Document _doc, java.lang.Object[] _path, java.lang.String _localeName)
public static final void applyL10n(electric.xml.Element _el, java.lang.Object[] _path)
public static final void applyL10n(electric.xml.Element _el, java.lang.Object[] _path, java.lang.String _localeName)
public static final java.lang.String msg(java.lang.String key, byte arg0)
#msg(String, Object[])
.
This method provides a simplified way to generate a message string using a key and a single byte
argument.
It is intended for scenarios where only one byte
argument is needed, thereby avoiding the need to create an array manually.
*
key
- the l10n key used to identify the l10n message templatearg0
- the byte
argument to be substituted into the message templatepublic static final java.lang.String msg(java.lang.String key, short arg0)
#msg(String, Object[])
.
This method provides a simplified way to generate a message string using a key and a single short
argument.
It is intended for scenarios where only one short
argument is needed, thereby avoiding the need to create an array manually.
*
key
- the l10n key used to identify the l10n message templatearg0
- the short
argument to be substituted into the message templatepublic static final java.lang.String msg(java.lang.String key, int arg0)
#msg(String, Object[])
.
This method provides a simplified way to generate a message string using a key and a single int
argument.
It is intended for scenarios where only one int
argument is needed, thereby avoiding the need to create an array manually.
*
key
- the l10n key used to identify the l10n message templatearg0
- the int
argument to be substituted into the message templatepublic static final java.lang.String msg(java.lang.String key, long arg0)
#msg(String, Object[])
.
This method provides a simplified way to generate a message string using a key and a single long
argument.
It is intended for scenarios where only one long
argument is needed, thereby avoiding the need to create an array manually.
*
key
- the l10n key used to identify the l10n message templatearg0
- the long
argument to be substituted into the message templatepublic static final java.lang.String msg(java.lang.String key, java.lang.Number arg0)
#msg(String, Object[])
.
This method provides a simplified way to generate a message string using a key and a single Number
argument.
It is intended for scenarios where only one Number
argument is needed, thereby avoiding the need to create an array manually.
*
key
- the l10n key used to identify the proper l10n entryarg0
- the Number
argument to be substituted into the message templatepublic static final java.lang.String msg(java.lang.String key, java.lang.String arg0)
#msg(String, Object[])
.
This method provides a simplified way to generate a message string using a key and a single String
argument.
It is intended for scenarios where only one String
argument is needed, thereby avoiding the need to create an array manually.
*
key
- the l10n key used to identify the proper l10n entryarg0
- the String
argument to be substituted into the message templatepublic static final java.lang.String msg(java.lang.String key, java.lang.String arg0, java.lang.String arg1)
#msg(String, Object[])
.
This method provides a simplified way to generate a message string using a key and two String
arguments.
It is intended for scenarios where only two String
arguments are needed, thereby avoiding the need to create an array manually.
*
key
- the l10n key used to identify the proper l10n entryarg0
- the first String
argument to be substituted into the message templatearg1
- the second String
argument to be substituted into the message templatepublic static final java.lang.String msg(java.lang.String key, java.lang.String arg0, java.lang.String arg1, java.lang.String arg2)
#msg(String, Object[])
.
This method provides a simplified way to generate a message string using a key and three String
arguments.
It is intended for scenarios where only three String
arguments are needed, thereby avoiding the need to create an array manually.
*
key
- the l10n key used to identify the proper l10n entryarg0
- the first String
argument to be substituted into the message templatearg1
- the second String
argument to be substituted into the message templatearg2
- the third String
argument to be substituted into the message templatepublic static final java.lang.String msg(java.lang.String key, java.lang.String arg0, java.lang.String arg1, java.lang.String arg2, java.lang.String arg3)
#msg(String, Object[])
.
This method provides a simplified way to generate a message string using a key and four String
arguments.
It is intended for scenarios where only four String
arguments are needed, thereby avoiding the need to create an array manually.
*
key
- the l10n key used to identify the proper l10n entryarg0
- the first String
argument to be substituted into the message templatearg1
- the second String
argument to be substituted into the message templatearg2
- the third String
argument to be substituted into the message templatearg3
- the fourth String
argument to be substituted into the message templatepublic static final java.lang.String msg(java.lang.String key)
stackOffset
- not needed any more and ignored, but kept in for backwards compatibility.public static final java.lang.String msg(java.lang.String key, java.lang.Object[] args)
public static final java.lang.String msg(java.lang.String key, java.lang.Object[] args, int stackOffset)
public static final java.lang.String msgNoKey(java.lang.String key)
stackOffset
- not needed any more and ignored, but kept in for backwards compatibility.public static final java.lang.String msgNoKey(java.lang.String key, java.lang.Object[] args)
public static final java.lang.String msgNoKey(java.lang.String key, java.lang.Object[] args, int stackOffset)
public static final java.lang.String msg(java.lang.String key, java.lang.Object[] args, java.lang.Object[] _participants, boolean returnKeyWhenNotFound, java.util.Locale locale)
public static final java.lang.String msg(java.lang.String key, java.lang.Object[] args, java.lang.Object[] _participants)
public static final java.lang.String msg(java.lang.String key, java.lang.Object[] args, java.lang.Object[] _participants, boolean returnKeyWhenNotFound)
public static final java.lang.String msg(java.lang.String key, java.lang.Object[] args, java.lang.Object[] _participants, boolean returnKeyWhenNotFound, java.lang.String localeName)
public static final java.lang.String msg(java.lang.String key, java.lang.Object[] args, java.lang.String[] path)
key
- the key which shall be translated using L10nBundlesargs
- an Object array containing the values which shall be inserted for all occurences of {i}, i = 0, 1, ... in the replacement String from the L10nBundlespath
- a String array containing the names of the L10nBundles to use for looking up the keysreturnKeyWhenNotFound
- a boolean determining if, as a fallback, the passed key shall be returned, if no matching Bundle containing this key can be found in the system / in the pathlocaleName
- the name of the locale to use for resolving the translated String, e.g. de, en, fr or even de_DE, fr_LU, de_LU etc.useFallbackLocale
- determines if a fallback to a hard-coded fallback-locale should take place, if no matching Bundle containing this key can be found in the system / in the pathMessageFormat.format(String, Object...)
to the message template for the key.public static final java.lang.String msg(java.lang.String key, java.lang.Object[] args, java.lang.String[] path, boolean returnKeyWhenNotFound)
public static final java.lang.String msg(java.lang.String key, java.lang.Object[] args, java.lang.String[] path, boolean returnKeyWhenNotFound, java.lang.String localeName)
public static final java.lang.String msg(java.lang.String key, java.lang.Object[] args, java.lang.String[] path, boolean returnKeyWhenNotFound, java.lang.String localeName, boolean useFallbackLocale)
public static final java.lang.String msgNoFormat(java.lang.String key)
stackOffset
- not needed any more and ignored, but kept in for backwards compatibility.public static final java.lang.String msgNoFormat(java.lang.String key, int stackOffset)
public static final java.lang.String msgNoFormat(java.lang.String key, java.lang.String[] path)
key
- the key (name) of the L10nResource to findpath
- the names of the L10nBundles in which the matching resource should be searchedlocaleName
- name of a locale (optional); if null the current one will be usedpublic static final java.lang.String msgNoFormat(java.lang.String key, java.lang.String[] path, java.lang.String localeName)
public static final L10n.UnresolvedMessage resolveLater(java.lang.String msg, java.lang.Object[] parameters, java.lang.Object[] participants)
public static final L10n.UnresolvedMessage resolveLater(java.lang.String msg, java.lang.Object[] participants)
public static final L10n.UnresolvedMessage resolveLater(java.lang.String msg, java.lang.Object participant)
public static final L10nPack validPack(java.lang.String key, java.lang.String[] path)
public static final L10nPack validPack(java.lang.String key, java.lang.String[] path, java.lang.String localeName)
public static final java.lang.String[] getAutoPath()
_stackOffset
- not needed any more and ignored, but kept in for backwards compatibility.public static final java.lang.String[] getAutoPath(int _stackOffset)
public static java.util.function.Supplier<java.lang.String> getGetCallingClassNameImplementation()
public static final java.lang.String stringToKey(java.lang.String _str)
public static final java.lang.String stringToKey(java.lang.String _str, java.lang.String _prefix)
public static final java.lang.String[] compilePath(java.lang.Object[] participants)
public static final java.lang.String canonifyPackageName(java.lang.String s)
public static final void addPathCompilerForClass(java.lang.Class clazz, L10nPathCompilerI comp)
public static final void removePathCompilerForClass(java.lang.Class clazz, L10nPathCompilerI comp)
clazz
- The class for which the L10nPathCompilerI should be deregisteredcomp
- The L10nPathCompiler which should be deregistered.public static final void firePathCompilersChanged()
public boolean isOperational()
isOperational
in interface L10nPackProviderI
public static final L10nPack getPack(java.lang.String[] path, int index)
public static final L10nPack getPack(java.lang.String[] path, int index, java.lang.String ln)
public static final void addPreloadL10nCacheFinishedListener(PreloadL10nCacheFinishedListenerI l)
public static final void preloadCache(L10nPackProviderI provider, L10nPack[] packsToPreload, java.lang.String ln)
public static final void recalcPath()
public static final void flushCache()
public static final void flushCache(java.lang.String[] bundles)
public static final void flushCache(java.lang.String bundle)
public java.lang.String getL10nViaString()
getL10nViaString
in interface L10nPackProviderI
public L10nPack[] getL10nPacks(java.lang.String[] bundles, java.lang.String ln)
getL10nPacks
in interface L10nPackProviderI
public L10nPack getL10nPack(java.lang.String name, java.lang.String ln)
getL10nPack
in interface L10nPackProviderI
public L10nPathEntry[] getL10nPath()
getL10nPath
in interface L10nPackProviderI
public L10nPack internalGetL10nPack(java.lang.String name, java.lang.String ln)
public static final void prependPackProvider(L10nPackProviderI p)
public static final void appendPackProvider(L10nPackProviderI p)
public static final void removePackProvider(L10nPackProviderI p)
public static final void addLocaleChangeListener(L10nLocaleChangeListenerI _lcl)
public static final void setDefaultLocale(java.util.Locale l)
public static final void setCurrentLocaleProvider(L10nCurrentLocaleProviderI p)
public static final L10nCurrentLocaleProviderI getCurrentLocaleProvider()
public static final java.util.Locale getCurrentLocaleViaProvider()
public static final java.util.Locale getDefaultLocale()
public static final void setDefaultLocaleName(java.lang.String s)
public static final java.lang.String getDefaultLocaleName()
public static final boolean isParentOf(java.util.Locale supposedParent, java.util.Locale supposedChild)
public static final java.util.Locale getLocaleFromString(java.lang.String s)
public static final L10nDecimalFormat getDecimalFormat()
_pattern
- The DecimalFormat pattern to use (see JDK API Docs)_locale
- The designated Locale for this patternpublic static final L10nDecimalFormat getDecimalFormat(java.lang.String _pattern)
public static final L10nDecimalFormat getDecimalFormat(java.lang.String _pattern, java.util.Locale _locale)
public static final void releaseDecimalFormat(L10nDecimalFormat df)
public static final java.lang.String formatDecimal(java.lang.Number n)
public static final java.lang.String formatDecimal(java.lang.Number n, java.lang.String pattern)
public static final java.lang.String formatDecimal(java.lang.Number n, java.lang.String pattern, java.util.Locale _locale)
public static final java.lang.String formatDecimalNT(java.lang.Number n, java.lang.String pattern, java.lang.String fallback)
public static final java.lang.String formatDecimalNT(java.lang.Number n)
public static final java.lang.String formatDecimalNT(java.lang.Number n, java.lang.String pattern)
public static final java.lang.String formatDecimalNT(java.lang.Number n, java.lang.String pattern, java.util.Locale locale)
public static final java.lang.String formatDecimalNT(java.lang.Number n, java.lang.String pattern, java.util.Locale locale, java.lang.String fallback)
public static final java.math.BigDecimal parseDecimal(java.lang.String s) throws java.text.ParseException
s
- the input string to parsepattern
- FIXME link to pattern description_local
- the locale of the source string, e.g. GERMAN for 12,3 or US for 12.3java.text.ParseException
public static final java.math.BigDecimal parseDecimal(java.lang.String s, java.lang.String pattern) throws java.text.ParseException
java.text.ParseException
public static final java.math.BigDecimal parseDecimal(java.lang.String s, java.lang.String pattern, java.util.Locale _locale) throws java.text.ParseException
java.text.ParseException
public static final java.math.BigDecimal parseDecimal(java.lang.String s, java.lang.String[] patterns) throws MultipleParseException
MultipleParseException
public static final java.math.BigDecimal parseDecimal(java.lang.String s, java.lang.String[] patterns, java.util.Locale _locale) throws MultipleParseException
MultipleParseException
public static final java.math.BigDecimal parseDecimalNT(java.lang.String s)
public static final java.math.BigDecimal parseDecimalNT(java.lang.String s, java.lang.String pattern)
public static final java.math.BigDecimal parseDecimalNT(java.lang.String s, java.lang.String pattern, java.math.BigDecimal fallback)
public static final java.math.BigDecimal parseDecimalNT(java.lang.String s, java.lang.String[] patterns)
public static final java.math.BigDecimal parseDecimalNT(java.lang.String s, java.lang.String[] patterns, java.math.BigDecimal fallback)
public static final L10nDateFormat getDateFormat()
public static final L10nDateFormat getDateFormat(java.lang.String _pattern)
public static final L10nDateFormat getDateFormat(java.lang.String _pattern, java.util.Locale _locale)
public static final L10nDateFormat getDateFormat(java.lang.String _pattern, java.util.Locale _locale, java.util.TimeZone timeZone)
public static final void releaseDateFormat(L10nDateFormat df)
public static final java.lang.String formatDate(java.util.Date d)
public static final java.lang.String formatDate(java.util.Date d, java.lang.String pattern)
public static final java.lang.String formatDate(java.util.Date d, java.lang.String pattern, java.util.Locale _locale)
public static final java.lang.String formatDate(java.util.Date d, java.lang.String pattern, java.util.Locale _locale, java.util.TimeZone timeZone)
public static final java.lang.String formatDateNT(java.util.Date d, java.lang.String pattern, java.lang.String fallback)
public static final java.lang.String formatDateNT(java.util.Date d)
public static final java.lang.String formatDateNT(java.util.Date d, java.lang.String pattern)
public static final java.lang.String formatDateNT(java.util.Date d, java.lang.String pattern, java.util.Locale locale)
public static final java.lang.String formatDateNT(java.util.Date d, java.lang.String pattern, java.util.Locale locale, java.lang.String fallback)
public static final java.util.Date parseDate(java.lang.String s) throws java.text.ParseException
java.text.ParseException
public static final java.util.Date parseDate(java.lang.String s, java.lang.String pattern) throws java.text.ParseException
java.text.ParseException
public static final java.util.Date parseDate(java.lang.String s, java.lang.String pattern, java.util.Locale _locale) throws java.text.ParseException
java.text.ParseException
public static final java.util.Date parseDate(java.lang.String s, java.lang.String pattern, java.util.Locale _locale, java.util.TimeZone timeZone) throws java.text.ParseException
java.text.ParseException
public static final java.util.Date parseDateNT(java.lang.String s)
public static final java.util.Date parseDateNT(java.lang.String s, java.lang.String pattern)
public static final java.util.Date parseDateNT(java.lang.String s, java.lang.String pattern, java.util.Date fallback)
public static final java.util.Date parseDateNT(java.lang.String s, java.lang.String[] patterns)
public static final java.util.Date parseDateNT(java.lang.String s, java.lang.String[] patterns, java.util.Date fallback)
public static final java.util.Date parseDate(java.lang.String s, java.lang.String[] patterns) throws MultipleParseException
MultipleParseException
public static final java.util.Date parseDate(java.lang.String s, java.lang.String[] patterns, java.util.Locale _locale) throws MultipleParseException
MultipleParseException
public static final java.util.Date parseDate(java.lang.String s, java.lang.String[] patterns, java.util.Locale _locale, java.util.TimeZone timeZone) throws MultipleParseException
MultipleParseException
public static final java.util.Date parseISO8601(java.lang.String s) throws java.time.format.DateTimeParseException
java.time.OffsetDateTime#parse(String)
.
Expected formats are yyyy-MM-dd'T'HH:mm:ss.SSSX or yyyy-MM-dd'T'HH:mm:ssX
The resolution of the result will be limited by the maximum resolution possible of Date, i.e. milliseconds.
Nanosecond information of the input will be ignored.s
- an ISO conformant String, not null.java.time.format.DateTimeParseException
public static final java.util.Date parseISO8601NT(java.lang.String s)
parseISO8601(String)
, returning the fallback if the given String is not a valid ISO datepublic static final java.util.Date parseISO8601NT(java.lang.String s, java.util.Date fallback)
public static final java.util.Date parseISODate(java.lang.String s) throws MultipleParseException
s
- the date(time) to parse, nonnull.MultipleParseException
public static final java.util.Date parseISODateNT(java.lang.String s)
public static final java.util.Date parseISODateNT(java.lang.String s, java.util.Date fallback)
public static final java.lang.String formatISODate(java.util.Date d)
public static final java.lang.String formatISODateNT(java.util.Date d)
public static final java.lang.String formatISODateNT(java.util.Date d, java.lang.String fallback)
public static final java.lang.String formatISO8601(java.util.Date date)
parseISO8601(String)
.
e.g. 2021-02-25T14:15:00.001Z or 2021-02-25T15:15:00.001+01:00date
- the date to format, not null.withLocalTimeZone
- defaults to false, which will return the date in Zulu time, aka GMT+0.
If true, the current default timezone is used to format the date.
The represented point in time will be identical in either case.OffsetDateTime.ofInstant(Instant, ZoneId)
public static final java.lang.String formatISO8601(java.util.Date date, boolean withLocalTimeZone)
public static final java.lang.String formatISO8601NT(java.util.Date date)
#formatISO8601Date(Date, boolean)
. Defaults to the empty String on error.public static final java.lang.String formatISO8601NT(java.util.Date date, java.lang.String fallback)
public static final java.lang.String formatISO8601NT(java.util.Date date, java.lang.String fallback, boolean withLocalTimeZone)
public static final L10nTimespanFormat getTimespanFormat()
public static final L10nTimespanFormat getTimespanFormat(java.lang.String pattern)
public static final L10nTimespanFormat getTimespanFormat(java.lang.String pattern, java.util.Locale locale)
public static final void releaseTimespanFormat(L10nTimespanFormat df)
public static final java.lang.String formatTimespan(java.lang.Number _ts)
_ts
- timespan in millisecondspublic static final java.lang.String formatTimespan(java.lang.Number _ts, java.lang.String _pattern)
public static final java.lang.String formatTimespan(java.lang.Number _ts, java.lang.String _pattern, java.util.Locale _locale)
public static final java.lang.Long parseTimespan(java.lang.String _str) throws java.text.ParseException
java.text.ParseException
public static final java.lang.Long parseTimespan(java.lang.String _str, java.lang.String _pattern) throws java.text.ParseException
java.text.ParseException
public static final java.lang.Long parseTimespan(java.lang.String _str, java.lang.String _pattern, java.util.Locale _locale) throws java.text.ParseException
java.text.ParseException
public static final java.lang.Long parseTimespan(java.lang.String _str, java.lang.String[] _patterns) throws MultipleParseException
MultipleParseException
public static final java.lang.Long parseTimespan(java.lang.String _str, java.lang.String[] _patterns, java.util.Locale _locale) throws MultipleParseException
MultipleParseException
public static final java.lang.String formatDuration(javax.xml.datatype.Duration _dur)
public static final java.lang.String formatDuration(javax.xml.datatype.Duration _dur, java.lang.String _pattern)
public static final java.lang.String formatDuration(javax.xml.datatype.Duration _dur, java.lang.String _pattern, java.util.Locale _locale)
public static final javax.xml.datatype.Duration parseDuration(java.lang.String s)
public static final java.lang.String getWaehrungsSymbol(java.lang.String isocode)
public static final java.text.Collator getCollator()
public static final java.text.Collator getCollator(java.util.Locale l)
public static final java.text.Collator getCollator(java.util.Locale l, java.lang.String parms)
public static final java.lang.String[] splitPath(java.lang.String _path)
public static final java.lang.String getLanguageSeperatedByDash(java.lang.String _str, int _lang)
Copyright © 2000-2025 OAshi S.à r.l. All Rights Reserved.