|
EAF 7.6 Implementation | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.enhydra.i18n.ResManager
public class ResManager
Some helper functions for handeling i18n issues. One instance of this class should be created for each resource bundle.
The ResManager is created by a call to getResourceManager()
the parameter is the name of the package that contails the Res class.
e.g. ResManager rez = getResourceBundle("org.enhydra.mypackagename");
To use the ResManager make a call to any of the format()
methods. In the default resource bundle the key is the same as the value.
So to display "I am 2 years old" call rez.format("I am {0} years old",2);
If the string "I am {0} years old" is in the bundle the value is returned. If
string is not found in the bundle the key is returned and an error is logged
to I18N_DEBUG. To see these errors add DEBUG_I18N to Server.LogToFile[] and
Server.LogToStderr[] in multiserver.conf.
Method Summary | |
---|---|
java.lang.String |
format(java.lang.String key)
Returns a string that has been obtained from the resource manager |
java.lang.String |
format(java.lang.String pattern,
java.lang.Object o0)
Returns a string that has been obtained from the resource manager then formatted using the passed parameters. |
java.lang.String |
format(java.lang.String pattern,
java.lang.Object o0,
java.lang.Object o1)
Returns a string that has been obtained from the resource manager then formatted using the passed parameters. |
java.lang.String |
format(java.lang.String pattern,
java.lang.Object o0,
java.lang.Object o1,
java.lang.Object o2)
Returns a string that has been obtained from the resource manager then formatted using the passed parameters. |
java.lang.String |
format(java.lang.String pattern,
java.lang.Object o0,
java.lang.Object o1,
java.lang.Object o2,
java.lang.Object o3)
Returns a string that has been obtained from the resource manager then formatted using the passed parameters. |
static ResManager |
getResManager(java.lang.Class clazz)
Returns a resource manager assocated with the package name. |
static ResManager |
getResManager(java.lang.String packageName)
Returns a resource manager assocated with the package name. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static ResManager getResManager(java.lang.Class clazz)
clazz
- A class from the package that Rez is in.public static ResManager getResManager(java.lang.String packageName)
packageName
- The package name that holds the Res classpublic java.lang.String format(java.lang.String key)
key
- The string that is the key to the translated messagepublic java.lang.String format(java.lang.String pattern, java.lang.Object o0)
key
- The string that is the key to the translated messageo0
- The param passed to format replaces {0}public java.lang.String format(java.lang.String pattern, java.lang.Object o0, java.lang.Object o1)
key
- The string that is the key to the translated messageo0
- The param passed to format replaces {0}o1
- The param passed to format replaces {1}public java.lang.String format(java.lang.String pattern, java.lang.Object o0, java.lang.Object o1, java.lang.Object o2)
key
- The string that is the key to the translated messageo0
- The param passed to format replaces {0}o1
- The param passed to format replaces {1}o2
- The param passed to format replaces {2}public java.lang.String format(java.lang.String pattern, java.lang.Object o0, java.lang.Object o1, java.lang.Object o2, java.lang.Object o3)
key
- The string that is the key to the translated messageo0
- The param passed to format replaces {0}o1
- The param passed to format replaces {1}o2
- The param passed to format replaces {2}o3
- The param passed to format replaces {3}
|
EAF 7.6 Implementation | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |