|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.filenet.wcm.toolkit.util.WcmStringResources
This class manages String resources for various locales so that multiple locales WcmString and WcmException translations can be available simultaneously. For configuring additional ResourceParser resources, look at the add...BundleToPath signatures. String resources for a locale are loaded on demand, and reset to reload whenever one of the paths is changed.
Field Summary | |
protected static java.lang.String |
DEFAULT_LOCALE_VALUE
|
static java.lang.String |
EXCEPTION_CONFIG_NAME
|
protected static java.lang.String |
EXCEPTION_PREFIX
|
static java.lang.String |
SESSION_LOCALE_KEY
|
static java.lang.String |
STRING_CONFIG_NAME
|
protected static java.lang.String |
STRING_PREFIX
|
Constructor Summary | |
WcmStringResources()
|
Method Summary | |
static void |
addExceptionBundleToPath(ResourceBundle bundle)
Use this call to define additional WcmException resource bundles so that they are picked up at runtime. |
static void |
addExceptionBundleToPath(java.lang.String path,
java.lang.String name)
Use this call to define additional WcmException resource bundles so that they are picked up at runtime. |
static void |
addExceptionJarBundleToPath(java.lang.String path,
java.lang.String name,
java.lang.Class loaderClass)
Use this call to define additional WcmString resource bundles so that they are picked up at runtime. |
static void |
addExceptionWarBundleToPath(java.lang.String path,
java.lang.String name,
javax.servlet.ServletContext application)
Use this call to define additional WcmString resource bundles so that they are picked up at runtime. |
static void |
addLegacyPRB(boolean exception,
java.io.InputStream in)
Deprecated. - Use add...BundleToPath sigs. |
static void |
addLegacyPRB(boolean exception,
java.util.Map m)
Deprecated. - Use add...BundleToPath sigs. |
static void |
addStringBundleToPath(ResourceBundle bundle)
Use this call to define additional WcmString resource bundles so that they are picked up at runtime. |
static void |
addStringBundleToPath(java.lang.String path,
java.lang.String name)
Use this call to define additional WcmString resource bundles so that they are picked up at runtime. |
static void |
addStringJarBundleToPath(java.lang.String path,
java.lang.String name,
java.lang.Class loaderClass)
Use this call to define additional WcmString resource bundles so that they are picked up at runtime. |
static void |
addStringWarBundleToPath(java.lang.String path,
java.lang.String name,
javax.servlet.ServletContext application)
Use this call to define additional WcmString resource bundles so that they are picked up at runtime. |
static ResourceBundle |
getBundle(java.lang.String path,
java.lang.String name)
Factory method that creates a ResourceBundle object for resources stored directly on a local drive. |
static java.util.Locale |
getClientLocale(javax.servlet.ServletRequest request)
Get the locale to use for localization. |
static java.lang.String |
getExceptionResource(java.util.Locale locale,
java.lang.String key,
java.lang.String defaultString)
Retrieve an Exception resource by key for the specified locale. |
static ResourceBundle |
getJarBundle(java.lang.String path,
java.lang.String name,
java.lang.Class loaderClass)
Factory method that creates a ResourceBundle object relative to a JAR file. |
static java.lang.String |
getStringResource(java.util.Locale locale,
java.lang.String key,
java.lang.String defaultString)
Retrieve a String resource by key for the specified locale. |
static ResourceBundle |
getWarBundle(java.lang.String path,
java.lang.String name,
javax.servlet.ServletContext application)
Factory method that creates a ResourceBundle object relative to a WAR file. |
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 STRING_CONFIG_NAME
public static final java.lang.String EXCEPTION_CONFIG_NAME
public static final java.lang.String SESSION_LOCALE_KEY
protected static final java.lang.String STRING_PREFIX
protected static final java.lang.String EXCEPTION_PREFIX
protected static final java.lang.String DEFAULT_LOCALE_VALUE
Constructor Detail |
public WcmStringResources()
Method Detail |
public static ResourceBundle getJarBundle(java.lang.String path, java.lang.String name, java.lang.Class loaderClass)
path
- The path within the JAR. Leave blank to reference the package/directory where
the class is located. Leading slash indicates relative to the JAR's root. No
leading slash indicates relative to where the class is located.name
- The resource bundle name for example, "WcmStringConfiguration"loaderClass
- If defined, it's getResourceAsStream is used.
public static ResourceBundle getWarBundle(java.lang.String path, java.lang.String name, javax.servlet.ServletContext application) throws java.net.MalformedURLException
path
- The path relative to the web application's root, where the resources are located.name
- The resource bundle name for example, "WcmStringConfiguration"application
- The ServletContext object.
java.net.MalformedURLException
public static ResourceBundle getBundle(java.lang.String path, java.lang.String name)
path
- The fully qualified local path to the location of the resources.name
- The resource bundle name for example, "WcmStringConfiguration"
public static void addStringBundleToPath(ResourceBundle bundle)
bundle
- - The ResourceBundle object to add.public static void addExceptionBundleToPath(ResourceBundle bundle)
bundle
- - The ResourceBundle object to add.public static void addStringJarBundleToPath(java.lang.String path, java.lang.String name, java.lang.Class loaderClass)
path
- The path within the JAR. Leave blank to reference the package/directory where
the class is located. Leading slash indicates relative to the JAR's root. No
leading slash indicates relative to where the class is located.name
- The resource bundle name for example, "WcmStringConfiguration"loaderClass
- If defined, it's getResourceAsStream is used.public static void addExceptionJarBundleToPath(java.lang.String path, java.lang.String name, java.lang.Class loaderClass)
path
- The path within the JAR. Leave blank to reference the package/directory where
the class is located. Leading slash indicates relative to the JAR's root. No
leading slash indicates relative to where the class is located.name
- The resource bundle name for example, "WcmStringConfiguration"loaderClass
- public static void addStringWarBundleToPath(java.lang.String path, java.lang.String name, javax.servlet.ServletContext application) throws java.net.MalformedURLException
path
- The path relative to the web application's root, where the resources are located.name
- The resource bundle name for example, "WcmStringConfiguration"application
- The ServletContext object.
java.net.MalformedURLException
public static void addExceptionWarBundleToPath(java.lang.String path, java.lang.String name, javax.servlet.ServletContext application) throws java.net.MalformedURLException
path
- The path relative to the web application's root, where the resources are located.name
- The resource bundle name for example, "WcmStringConfiguration"application
- The ServletContext object.
java.net.MalformedURLException
public static void addStringBundleToPath(java.lang.String path, java.lang.String name)
path
- The fully qualified local path to the location of the resources.name
- The resource bundle name for example, "WcmStringConfiguration"public static void addExceptionBundleToPath(java.lang.String path, java.lang.String name)
path
- The fully qualified local path to the location of the resources.name
- The resource bundle name for example, "WcmExceptionConfiguration"public static void addLegacyPRB(boolean exception, java.io.InputStream in) throws java.io.IOException
java.io.IOException
public static void addLegacyPRB(boolean exception, java.util.Map m)
public static java.lang.String getStringResource(java.util.Locale locale, java.lang.String key, java.lang.String defaultString)
locale
- key
- defaultString
-
public static java.lang.String getExceptionResource(java.util.Locale locale, java.lang.String key, java.lang.String defaultString)
locale
- key
- defaultString
-
public static java.util.Locale getClientLocale(javax.servlet.ServletRequest request)
request
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |