|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectariba.util.core.ResourceService
public class ResourceService
The fundamental API to resolving localized resources. Subclassers should implement the get* primitives based on specific resource resolution strategies.
Nested Class Summary | |
---|---|
static interface |
ResourceService.Localizer
|
static interface |
ResourceService.PseudoLocalizer
|
static class |
ResourceService.ResourceLocation
Is an enumerated type representing the locations where string resources may be found under the string resource base URL. |
Field Summary | |
---|---|
java.net.URL |
baseURL
The base URL for resolving resources |
static java.lang.String |
EmbeddedSubstitutionsFlag
|
static java.util.Locale |
LocaleOfLastResort
Locale of last resort. |
static java.lang.String |
NlsTag
Prefix for resource keys. |
static java.lang.String |
ReportTemplatesDirectory
Reports Template directory. |
Constructor Summary | |
---|---|
ResourceService(java.net.URL baseURL,
java.util.Locale defaultLocale)
Creates a new ResourceService with the given base URL and default locale. |
|
ResourceService(java.net.URL stringBaseURL,
java.net.URL baseURL,
java.util.Locale defaultLocale)
|
Method Summary | |
---|---|
static ResourceService.PseudoLocalizer |
_getPseudoLocalizer()
|
static void |
_setPseudoLocalizer(ResourceService.PseudoLocalizer pl)
|
void |
cacheImageMap(java.util.Map imageMap,
java.util.Locale locale)
Puts the imageMap in the cache under the given
locale . |
void |
cacheStringTable(java.lang.String path,
java.util.Locale locale,
java.util.Map stringTable,
StringTableProcessor processor)
Allows you to prepopulate the string table cache. |
void |
cacheStringTable(java.lang.String path,
java.util.Map stringTable)
Allows you to prepopulate the string table cache. |
static ResourceService |
checkForService()
Returns a reference to the shared ResourceService. |
void |
clearCache()
Allows you to "reboot" the Resource Manager, so you don't have to shut down everything just to reload a string resource that's changed on disk. |
static void |
createLocalizedMap(java.util.Map table,
java.util.Locale locale)
If a Map contains a string starting with an '@', it is assumed to be a localized string key which is localized using the localizedCompositeKey(). |
java.lang.Object |
descendAndLocalizeObject(java.lang.Object object,
java.util.Locale locale)
Traverses an object (if it is an Map, List, or String), and for all strings that start with '@', replaces it with a localized string for the specified locale, using the method getLocalizedCompositeKey(java.lang.String, java.util.Locale) . |
java.lang.Object |
descendAndLocalizeObject(java.lang.Object object,
java.util.Locale locale,
ResourceService.Localizer localizer)
Traverses an object (if it is an Map, List, or String), and for all strings that start with '@', replaces it with a localized string for the specified locale, using the method getLocalizedCompositeKey(java.lang.String, java.util.Locale) . |
java.lang.String |
findResourceURL(java.lang.String filename,
java.util.Locale locale)
Returns the url string of file for the given locale |
java.util.Set<java.lang.String> |
getAllStringTableNames(java.util.Locale locale)
Returns the set of all string table names that exist and may contain resources for the specified locale. |
java.lang.String |
getDefaultImagesRoot()
Returns the defaultImagesRoot. |
java.util.Locale |
getDefaultLocale()
Returns the default locale. |
StringTableProcessor |
getDefaultStringTableProcessor()
|
java.util.Locale |
getLocale()
Returns the "default" locale that clients should use. |
java.util.List |
getLocales()
This is to add a backdoor to ResourceService for Inspector to get a list of Locale UniqueName Strings |
java.lang.String |
getLocalizedCompositeFormat(java.lang.String string,
java.util.Locale locale,
boolean displayWarning,
boolean defaulting)
|
java.lang.String |
getLocalizedCompositeKey(java.lang.String string,
java.util.Locale locale)
If the specified string starts with an '@', it is assummed to be a composed localized string key (the string table and key are concatenated, separated by a slash (e.g. |
java.lang.String |
getLocalizedCompositeKey(java.lang.String string,
java.util.Locale locale,
boolean displayWarning)
If the specified string starts with an '@', it is assummed to be a composed localized string key (the string table and key are concatenated, separated by a slash (e.g. |
java.lang.String |
getLocalizedCompositeKey(java.lang.String string,
java.util.Locale locale,
boolean displayWarning,
boolean defaulting)
If the specified string starts with an '@', it is assummed to be a composed localized string key (the string table and key are concatenated, separated by a slash (e.g. |
java.lang.String |
getLocalizedCompositeKey(java.lang.String string,
java.util.Locale locale,
boolean displayWarning,
boolean defaulting,
boolean resolveDynamicKeys)
If the specified string starts with an '@', it is assummed to be a composed localized string key (the string table and key are concatenated, separated by a slash (e.g. |
java.lang.String |
getLocalizedFormat(java.lang.String stringTable,
java.lang.String key,
java.util.Locale locale)
Lookup a localized string for the specified locale. |
java.lang.String |
getLocalizedFormat(java.lang.String stringTable,
java.lang.String key,
java.util.Locale locale,
boolean displayWarning,
boolean defaultingLocale,
boolean defaultingSystem)
Lookup a localized string for the specified locale. |
java.lang.String |
getLocalizedHelpPath(java.lang.String helpPath)
Returns the path of the root of the help system for this service's locale. |
java.lang.String |
getLocalizedHelpPath(java.lang.String helpPath,
java.util.Locale locale)
Returns the path of the root of the help system for the specified locale. |
java.lang.String |
getLocalizedImagePath(java.lang.String path)
Returns a localized image path in the service's locale. |
java.lang.String |
getLocalizedImagePath(java.lang.String path,
java.util.Locale locale)
Returns a localized image path in the specified locale. |
java.lang.String |
getLocalizedString(java.lang.String stringTable,
java.lang.String key)
Lookup a localized string for this service's locale, which is obtained by calling getLocale() . |
java.lang.String |
getLocalizedString(java.lang.String stringTable,
java.lang.String key,
java.util.Locale locale)
Lookup a localized string for the specified locale. |
java.lang.String |
getLocalizedString(java.lang.String stringTable,
java.lang.String key,
java.util.Locale locale,
boolean displayWarning)
Lookup a localized string for the specified locale. |
java.lang.String |
getLocalizedString(java.lang.String stringTable,
java.lang.String key,
java.util.Locale locale,
boolean displayWarning,
boolean defaultingLocale)
Lookup a localized string for the specified locale. |
java.lang.String |
getLocalizedString(java.lang.String stringTable,
java.lang.String key,
java.util.Locale locale,
boolean displayWarning,
boolean defaultingLocale,
boolean defaultingSystem)
Lookup a localized string for the specified locale. |
java.util.Locale |
getOverrideLocale()
This is to add a backdoor to ResourceService to allow docs and QA folks to force the HTML UI to render in a certain locale. |
boolean |
getOverrideLocaleOn()
This is to add a backdoor to ResourceService to allow docs and QA folks to force the HTML UI to render in a certain locale. |
java.util.Locale |
getRestrictedLocale(java.util.Locale locale)
Get a locale that is guaranteed to be available to the realm. |
java.util.List<java.util.Locale> |
getSearchDirs(java.util.Locale givenLocale,
boolean defaulting)
Returns list of directories to search for the given locale. |
static ResourceService |
getService()
Returns a reference to the shared ResourceService. |
static java.lang.String |
getString(java.lang.String stringTable,
java.lang.String key)
A convenience using the service() and the locale, which is obtained by calling getLocale() . |
static java.lang.String |
getString(java.lang.String stringTable,
java.lang.String key,
java.util.Locale locale)
A convenience using the service() and the specified locale. |
static java.lang.String |
getString(java.lang.String stringTable,
java.lang.String key,
java.util.Locale locale,
boolean displayWarning)
A convenience using the service(), the specified locale, and whether to display a warning if not found. |
static java.lang.String |
getString(java.lang.String stringTable,
java.lang.String key,
java.lang.String optionalKeyPrefix,
java.util.Locale locale)
A convenience using the service() and the specified locale. |
java.lang.String |
helpDirectoryForLocale(java.util.Locale locale)
Returns the locale directory that contains help for the specified locale. |
java.util.Map |
imageMap(java.util.Locale locale)
Returns an image map localized in the specified locale. |
static boolean |
isNlsKey(java.lang.String str)
A convenience for checking if a given string is a resource key. |
java.lang.String[] |
parseCompositeKey(java.lang.String compositeKey)
Break a composite key into its parts. |
static void |
popOverlayForTable(java.lang.String tableName,
java.lang.String prev)
Pop a previously pushed overlay from the thread state |
static java.lang.String |
pushOverlayForTable(java.lang.String tableName,
java.lang.String overlayTableName)
Called by app code to push an "overlay" resource file for a particular file onto the current thread state. |
static void |
registerDynamicTableName(java.lang.String tableName)
Called by app code at initialization to register resource files ("tables") that may later be overlaid via pushOverlayForTable() |
void |
registerStringProcessor(StringTableProcessor processor)
register string processor. |
java.lang.String |
reportTemplateDirectoryForLocale(java.util.Locale locale)
Returns the locale directory that contains reports template for the specified locale. |
static ResourceService |
serviceCouldBeNull()
Returns pointer to shared ResourceService. |
void |
setDefaultLocale(java.util.Locale locale)
Sets the default locale. |
void |
setLocales(java.util.List locales)
This is to add a backdoor to ResourceService for LocaleID to set a list of Locale UniqueNames |
void |
setOverrideLocale(java.util.Locale overrideLocale)
This is to add a backdoor to ResourceService to allow docs and QA folks to force the HTML UI to render in a certain locale. |
void |
setOverrideLocaleOn(boolean overrideLocaleOn)
This is to add a backdoor to ResourceService to allow docs and QA folks to force the HTML UI to render in a certain locale. |
static void |
setService(ResourceService service)
Sets up the shared ResourceService. |
static java.lang.String |
string(java.lang.String stringTable,
java.lang.String key)
Deprecated. Replaced by getString(String, String) |
static java.lang.String |
string(java.lang.String stringTable,
java.lang.String key,
java.util.Locale locale)
Deprecated. Replaced by getString(String, String, Locale) |
java.util.Map |
stringTable(java.lang.String path,
java.util.Locale locale)
Returns a string table with the specified path in the specified locale. |
java.util.Map |
stringTable(java.lang.String path,
java.util.Locale locale,
boolean defaultingSystem)
Returns a string table with the specified path in the specified locale. |
java.util.Map |
stringTable(java.lang.String path,
java.util.Locale locale,
StringTableProcessor processor)
Returns a string table with the specified path in the specified locale. |
java.util.Map |
stringTable(java.lang.String path,
java.util.Locale locale,
StringTableProcessor processor,
boolean defaultingLocale)
Returns a string table with the specified path in the specified locale. |
java.util.Map |
stringTable(java.lang.String path,
java.util.Locale locale,
StringTableProcessor processor,
boolean defaultingLocale,
boolean defaultingSystem)
Returns a string table with the specified path in the specified locale. |
java.util.Map |
stringTableContent(java.lang.String path,
java.util.Locale locale,
boolean defaultingLocale,
boolean defaultingSystem)
Returns a flat string table with the specified path in the specified locale. |
java.util.Map |
stringTableContent(java.lang.String path,
java.util.Locale locale,
StringTableProcessor processor,
boolean defaultingLocale,
boolean defaultingSystem)
Returns a string table with the specified path in the specified locale. |
static java.lang.String |
translateDynamicString(java.lang.String string,
java.util.Locale locale)
Called on strings that may need further (contextual / dynamic) evaluation. |
void |
unsetLocalizedString(java.util.List listKeysToUnset,
java.lang.String stringTableName,
java.util.Locale locale)
Updates the designated resource file's by deleting the resources pointed by the keys stored in listOfKeysToUnset . |
void |
verifyCSV(java.io.InputStream resourceStream,
java.lang.String filePath)
Verifies that the supplied resourceStream is
a stream on a file that may legitimately be considered a
CSV resource file. |
void |
writeStringTable(java.lang.String stringTableName,
java.util.Locale locale,
java.io.InputStream inputStream)
Updates the designated resource file with contents of inputStream |
void |
writeStringTable(java.lang.String stringTableName,
java.util.Locale locale,
java.util.Map updates)
Updates the designated resource file with the objects stored in the given Map Important: The caller is responsible for the synchronization on the file (using GlobalLocking for instance) |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String NlsTag
public static final java.lang.String EmbeddedSubstitutionsFlag
public static final java.lang.String ReportTemplatesDirectory
public static final java.util.Locale LocaleOfLastResort
public java.net.URL baseURL
Constructor Detail |
---|
public ResourceService(java.net.URL baseURL, java.util.Locale defaultLocale)
baseURL
- base URLdefaultLocale
- default localepublic ResourceService(java.net.URL stringBaseURL, java.net.URL baseURL, java.util.Locale defaultLocale)
Method Detail |
---|
public static ResourceService checkForService()
public static ResourceService getService()
public static ResourceService serviceCouldBeNull()
public static void setService(ResourceService service)
service
- shared ResourceServicepublic static java.lang.String getString(java.lang.String stringTable, java.lang.String key)
getLocale()
.
stringTable
- the name of the string table to retrieve
the resource from.key
- they key to look up in that resource table.
getLocale()
public static java.lang.String string(java.lang.String stringTable, java.lang.String key)
stringTable
- tablekey
- keypublic static java.lang.String getString(java.lang.String stringTable, java.lang.String key, java.util.Locale locale)
stringTable
- the name of the string table to retrieve
the resource from.key
- they key to look up in that resource table.locale
- the locale to use for determining which
translation of the string table to use.
public static java.lang.String getString(java.lang.String stringTable, java.lang.String key, java.lang.String optionalKeyPrefix, java.util.Locale locale)
stringTable
- the name of the string table to retrieve
the resource from.key
- they key to look up in that resource table.optionalKeyPrefix
- key prefix if any.locale
- the locale to use for determining which
translation of the string table to use.
public static java.lang.String getString(java.lang.String stringTable, java.lang.String key, java.util.Locale locale, boolean displayWarning)
stringTable
- the name of the string table to retrieve
the resource from.key
- they key to look up in that resource table.locale
- the locale to use for determining which
translation of the string table to use.displayWarning
- if false and the key is not found in the
specified table a warning will be suppressed rather than
printed.
public static java.lang.String string(java.lang.String stringTable, java.lang.String key, java.util.Locale locale)
stringTable
- tablekey
- keylocale
- localepublic static boolean isNlsKey(java.lang.String str)
str
- a string to check if it follows our convention
for a resource key. A null will always return false.
public void setOverrideLocale(java.util.Locale overrideLocale)
overrideLocale
- locale to use as an overridepublic java.util.Locale getOverrideLocale()
public void setOverrideLocaleOn(boolean overrideLocaleOn)
overrideLocaleOn
- flag for override localepublic boolean getOverrideLocaleOn()
public void setLocales(java.util.List locales)
locales
- list of Locale UniqueName Stringspublic java.util.List getLocales()
public java.util.Locale getLocale()
public java.util.Locale getRestrictedLocale(java.util.Locale locale)
locale
- - the prospective locale
public java.util.Locale getDefaultLocale()
public void setDefaultLocale(java.util.Locale locale)
locale
- locale to set as the defaultpublic java.lang.String getDefaultImagesRoot()
public void registerStringProcessor(StringTableProcessor processor)
processor
- the StringTableProcessor to register, must not be null.public void clearCache()
public java.lang.String getLocalizedHelpPath(java.lang.String helpPath)
helpPath
- helpPath to localize
public java.lang.String getLocalizedHelpPath(java.lang.String helpPath, java.util.Locale locale)
helpPath
- locale
- public java.lang.String helpDirectoryForLocale(java.util.Locale locale)
locale
- locale
public java.lang.String reportTemplateDirectoryForLocale(java.util.Locale locale)
locale
- locale
public java.lang.String getLocalizedString(java.lang.String stringTable, java.lang.String key)
getLocale()
.
stringTable
- the name of the stringTable to usekey
- the key to lookup in the string table for the
locale
getLocale()
public java.lang.String getLocalizedString(java.lang.String stringTable, java.lang.String key, java.util.Locale locale)
stringTable
- the name of the stringTable to usekey
- the key to lookup in the string table for the
localelocale
- the locale to format the string in
public java.lang.String getLocalizedString(java.lang.String stringTable, java.lang.String key, java.util.Locale locale, boolean displayWarning)
stringTable
- the name of the stringTable to usekey
- the key to lookup in the string table for the
localelocale
- the locale to format the string indisplayWarning
- toggles the display of missing-key warning
public java.lang.String getLocalizedString(java.lang.String stringTable, java.lang.String key, java.util.Locale locale, boolean displayWarning, boolean defaultingLocale, boolean defaultingSystem)
stringTable
- the name of the stringTable to usekey
- the key to lookup in the string table for the
localelocale
- the locale to format the string indisplayWarning
- toggles the display of missing-key warningdefaultingLocale
- toggles defaulting to canonical/lastresort localedefaultingSystem
- toggles defaulting to system resource
This is being overwritten by BaseResourceService.java, only meaningful
for realm resources.public java.lang.String getLocalizedString(java.lang.String stringTable, java.lang.String key, java.util.Locale locale, boolean displayWarning, boolean defaultingLocale)
stringTable
- the name of the stringTable to usekey
- the key to lookup in the string table for the
localelocale
- the locale to format the string indisplayWarning
- toggles the display of missing-key warningdefaultingLocale
- toggles defaulting to canonical/lastresort locale
public java.lang.String getLocalizedFormat(java.lang.String stringTable, java.lang.String key, java.util.Locale locale)
stringTable
- the name of the stringTable to usekey
- the key to lookup in the string table for the
localelocale
- the locale to format the string in
This is being overwritten by BaseResourceService.java, only meaningful
for realm resources.public java.lang.String getLocalizedFormat(java.lang.String stringTable, java.lang.String key, java.util.Locale locale, boolean displayWarning, boolean defaultingLocale, boolean defaultingSystem)
stringTable
- the name of the stringTable to usekey
- the key to lookup in the string table for the
localelocale
- the locale to format the string indisplayWarning
- toggles the display of missing-key warningdefaultingLocale
- toggles defaulting to canonical/lastresort localedefaultingSystem
- toggles defaulting to system resource
This is being overwritten by BaseResourceService.java, only meaningful
for realm resources.public java.lang.String getLocalizedCompositeKey(java.lang.String string, java.util.Locale locale)
string
- string to localizelocale
- locale
public java.lang.String getLocalizedCompositeKey(java.lang.String string, java.util.Locale locale, boolean displayWarning)
string
- string to localizelocale
- localedisplayWarning
- toggles the display of missing-key warning
public static void registerDynamicTableName(java.lang.String tableName)
tableName
- Name of resource file that will be overlaid (e.g. "sourcing.core.Content")public static java.lang.String pushOverlayForTable(java.lang.String tableName, java.lang.String overlayTableName)
tableName
- file to be overlaid (e.g. "sourcing.core.Content")overlayTableName
- the overlay file (e.g. "sourcing.core.Content.Survey")
public static void popOverlayForTable(java.lang.String tableName, java.lang.String prev)
tableName
- file that had been overlaid (e.g. "sourcing.core.Content")prev
- the value returned from the corresponding call to push...()public java.lang.String getLocalizedCompositeKey(java.lang.String string, java.util.Locale locale, boolean displayWarning, boolean defaulting)
string
- string to localizelocale
- localedisplayWarning
- toggles the display of missing-key warningdefaulting
- toggles defaulting to rooted/last resort locale
public java.lang.String getLocalizedCompositeKey(java.lang.String string, java.util.Locale locale, boolean displayWarning, boolean defaulting, boolean resolveDynamicKeys)
string
- string to localizelocale
- localedisplayWarning
- toggles the display of missing-key warningdefaulting
- toggles defaulting to rooted/last resort localeresolveDynamicKeys
- whether keys that support dynamic substitution should be resolved. If false, caller
should later call getLocalizedStringWithDynamicResolution() at display time to get the final version
public static java.lang.String translateDynamicString(java.lang.String string, java.util.Locale locale)
public java.lang.String[] parseCompositeKey(java.lang.String compositeKey)
compositeKey
- The composite key to be parsed
public java.lang.String getLocalizedCompositeFormat(java.lang.String string, java.util.Locale locale, boolean displayWarning, boolean defaulting)
public static void createLocalizedMap(java.util.Map table, java.util.Locale locale)
table
- data for creating maplocale
- locale for creating mappublic java.util.Map stringTable(java.lang.String path, java.util.Locale locale)
path
- pathlocale
- locale
public java.util.Map stringTable(java.lang.String path, java.util.Locale locale, boolean defaultingSystem)
path
- pathlocale
- localedefaultingSystem
- defaulting to system
public java.util.Map stringTable(java.lang.String path, java.util.Locale locale, StringTableProcessor processor)
path
- pathlocale
- localeprocessor
- customer string csv processor
public java.util.Map stringTable(java.lang.String path, java.util.Locale locale, StringTableProcessor processor, boolean defaultingLocale)
path
- pathlocale
- localeprocessor
- customer string csv processordefaultingLocale
- toggle defaulting to relaxed locale
public java.util.Map stringTable(java.lang.String path, java.util.Locale locale, StringTableProcessor processor, boolean defaultingLocale, boolean defaultingSystem)
path
- pathlocale
- localeprocessor
- customer string csv processordefaultingLocale
- toggle defaulting to relaxed localedefaultingSystem
- toggles defaulting to system resource
public java.util.Map stringTableContent(java.lang.String path, java.util.Locale locale, boolean defaultingLocale, boolean defaultingSystem)
path
- pathlocale
- localedefaultingLocale
- toggle defaulting to relaxed localedefaultingSystem
- toggles defaulting to system resource
public java.util.Map stringTableContent(java.lang.String path, java.util.Locale locale, StringTableProcessor processor, boolean defaultingLocale, boolean defaultingSystem)
path
- pathlocale
- localeprocessor
- customer string csv processordefaultingLocale
- toggle defaulting to relaxed localedefaultingSystem
- toggles defaulting to system resource
public void cacheStringTable(java.lang.String path, java.util.Map stringTable)
path
- pathstringTable
- string table to populateariba.base.client.BaseClient#getStartupInfo
public void cacheStringTable(java.lang.String path, java.util.Locale locale, java.util.Map stringTable, StringTableProcessor processor)
path
- pathlocale
- locale for the resource tablestringTable
- string table to populateprocessor
- the processor who processed the tablepublic static void _setPseudoLocalizer(ResourceService.PseudoLocalizer pl)
public static ResourceService.PseudoLocalizer _getPseudoLocalizer()
public java.util.Set<java.lang.String> getAllStringTableNames(java.util.Locale locale)
public void verifyCSV(java.io.InputStream resourceStream, java.lang.String filePath) throws java.io.IOException
resourceStream
is
a stream on a file that may legitimately be considered a
CSV resource file.
By this we mean that the CSVReader
can parse the
file with a CSVStringTableConsumer
consuming the
tokens.
No exception is thrown if the stream is good.
NOTE:
resourceStream
- the stream to checkfilePath
- the logical name of the resource (for debugging and
error messages)
java.io.IOException
- if resourceStream
can not be
considered a CSV resource filepublic void writeStringTable(java.lang.String stringTableName, java.util.Locale locale, java.util.Map updates) throws java.io.IOException, FileReplacer.BadStateException
stringTableName
- the name of the resource table to updatelocale
- the locale of the resourcesupdates
- the map with only the key/value to update or add. For
deletion see
unsetLocalizedString(List, String, Locale)
FileReplacer.BadStateException
- when the system is in an unstable state
java.io.IOException
- when the operation didn't succeedpublic void writeStringTable(java.lang.String stringTableName, java.util.Locale locale, java.io.InputStream inputStream) throws java.io.IOException, FileReplacer.BadStateException
inputStream
Important notes:
inputStream
is not closed by this method (though it
is exhausted). It is responsibility of the client to close the
stream.
stringTableName
- the name of the resource table to updatelocale
- the locale of the resourcesinputStream
- the new file that will replace the stringTable
identified by stringTableName
FileReplacer.BadStateException
- when the system is in an unstable state
java.io.IOException
- when the operation didn't succeedpublic void unsetLocalizedString(java.util.List listKeysToUnset, java.lang.String stringTableName, java.util.Locale locale) throws java.io.IOException, FileReplacer.BadStateException
listOfKeysToUnset
.
listKeysToUnset
- the list of keys to delete from the resource filestringTableName
- the name of the resource filelocale
- the locale of the resource to delete
FileReplacer.BadStateException
- when the system reached an unrecoverable state
java.io.IOException
- when the operation didn't succeedpublic java.lang.String getLocalizedImagePath(java.lang.String path)
path
- path
public java.lang.String getLocalizedImagePath(java.lang.String path, java.util.Locale locale)
path
- pathlocale
-
public java.util.Map imageMap(java.util.Locale locale)
locale
- locale
public void cacheImageMap(java.util.Map imageMap, java.util.Locale locale)
imageMap
in the cache under the given
locale
.
imageMap
- image maplocale
- locale with which the image map will be associatedpublic java.util.List<java.util.Locale> getSearchDirs(java.util.Locale givenLocale, boolean defaulting)
givenLocale
- defaulting
- toggles between defaulting to relaxed locale or not
public java.lang.Object descendAndLocalizeObject(java.lang.Object object, java.util.Locale locale, ResourceService.Localizer localizer)
getLocalizedCompositeKey(java.lang.String, java.util.Locale)
. Will return a copy of the
appropriate sub-structure if any localization is done--this can be
understood as the fact that object
is not modified.
If the object is not a Map
, List
or
a String
, it is not altered and simply returned.
object
- the object to traverse and localizelocale
- the Locale
for which the localization should be
done
object
public java.lang.Object descendAndLocalizeObject(java.lang.Object object, java.util.Locale locale)
getLocalizedCompositeKey(java.lang.String, java.util.Locale)
. Will return a copy of the
appropriate sub-structure if any localization is done--this can be
understood as the fact that object
is not modified.
If the object is not a Map
, List
or
a String
, it is not altered and simply returned.
object
- the object to traverse and localizelocale
- the Locale
for which the localization should be
done
object
public java.lang.String findResourceURL(java.lang.String filename, java.util.Locale locale)
filename
- name of the filelocale
- locale for the file path
public StringTableProcessor getDefaultStringTableProcessor()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |