|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.openbp.common.rc.ResourceCollectionMgr
public class ResourceCollectionMgr
Manages resources (ResourceCollection).
The class can be instantiated for usage within a particular context, but also provides a global
default instance that should be used for access to regular application resources.
| Field Summary | |
|---|---|
static java.lang.String |
DEFAULT_LOCALE
Default locale directory |
static java.lang.String |
MEDIA_SUFFIX
Media file suffix |
static java.lang.String |
RC_FOLDER
Default locale directory |
| Constructor Summary | |
|---|---|
ResourceCollectionMgr()
Constructor. |
|
| Method Summary | |
|---|---|
void |
addResourceVariable(java.lang.String pattern,
java.lang.String replacement)
Adds a global resource text variable. |
static java.lang.String |
constructResourceCollectionLocalPath(java.lang.String containerName,
java.util.Locale locale,
java.lang.String resourceName)
Constructs the local path to a resource collection. |
java.util.Locale |
determineParentLocale(java.util.Locale locale)
Determines the parent locale of the given locale. |
static ResourceCollectionMgr |
getDefaultInstance()
Gets the singleton instance of this class. |
ResourceCollection |
getResource(java.lang.String containerName,
java.lang.Class cls)
Gets the resource for the given class using the default locale. |
ResourceCollection |
getResource(java.lang.String containerName,
java.lang.Class cls,
java.util.Locale locale)
Gets the resource for the given class using the given locale. |
ResourceCollection |
getResource(java.lang.String containerName,
java.lang.String resourceName)
Gets the resource using the default locale. |
ResourceCollection |
getResource(java.lang.String containerName,
java.lang.String resourceName,
java.util.Locale locale)
Gets the resource using the given locale. |
ResourceMgr |
getResourceMgr()
Gets the resource manager used to read the resource files. |
java.lang.String |
performVariableReplacement(java.lang.String text)
Performs any text replacements defined by addResourceVariable(java.lang.String, java.lang.String). |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String RC_FOLDER
public static final java.lang.String DEFAULT_LOCALE
public static final java.lang.String MEDIA_SUFFIX
| Constructor Detail |
|---|
public ResourceCollectionMgr()
| Method Detail |
|---|
public static ResourceCollectionMgr getDefaultInstance()
public ResourceCollection getResource(java.lang.String containerName,
java.lang.String resourceName)
containerName - Name of the resource container or nullresourceName - Name of the resource
public ResourceCollection getResource(java.lang.String containerName,
java.lang.Class cls)
containerName - Name of the resource container or nullcls - Class of the object requesting the resource
public ResourceCollection getResource(java.lang.String containerName,
java.lang.Class cls,
java.util.Locale locale)
containerName - Name of the resource container or nullcls - Class of the object requesting the resourcelocale - Locale to use; If the locale is null, the default locale will be used
public ResourceCollection getResource(java.lang.String containerName,
java.lang.String resourceName,
java.util.Locale locale)
containerName - Name of the resource container or nullresourceName - Name of the resourcelocale - Locale to use; If the locale is null, the default locale will be used
ResourceCollectionException - if no such resource collection in any matching locale could be found
public static java.lang.String constructResourceCollectionLocalPath(java.lang.String containerName,
java.util.Locale locale,
java.lang.String resourceName)
containerName - Container name or nulllocale - LocaleresourceName - Resource name
public java.util.Locale determineParentLocale(java.util.Locale locale)
locale - Locale to check
public void addResourceVariable(java.lang.String pattern,
java.lang.String replacement)
pattern - The pattern to search forreplacement - The substitute that will replace the pattern in the string
or null to remove the pattern from the stringpublic java.lang.String performVariableReplacement(java.lang.String text)
addResourceVariable(java.lang.String, java.lang.String).
text - Text to replace or null
public ResourceMgr getResourceMgr()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||