StringHelperpublic class StringHelper extends Object
Fields Summary |
---|
private static ResourceBundle | bundle |
Constructors Summary |
---|
private StringHelper()
|
Methods Summary |
---|
static java.lang.String | get(java.lang.String s)
try
{
return bundle.getString(s);
}
catch (Exception e)
{
// it is not an error to have no key...
return s;
}
| static java.lang.String | get(java.lang.String s, java.lang.Object o)Convenience method which calls get(String, Object[])
return get(s, new Object[] { o });
| static java.lang.String | get(java.lang.String s, java.lang.Object o1, java.lang.Object o2)Convenience method which calls get(String, Object[])
return get(s, new Object[] { o1, o2 });
| static java.lang.String | get(java.lang.String s, java.lang.Object o1, java.lang.Object o2, java.lang.Object o3)Convenience method which calls get(String, Object[])
return get(s, new Object[] { o1, o2, o3 });
| static java.lang.String | get(java.lang.String s, java.lang.Object[] objects)Get and format a String from LocalStrings.properties
s = get(s);
try
{
MessageFormat mf = new MessageFormat(s);
return mf.format(objects);
}
catch(Exception e)
{
return s;
}
| static void | main(java.lang.String[] notUsed)
try
{
String props = StringHelper.class.getPackage().getName() + ".LocalStrings";
bundle = ResourceBundle.getBundle(props);
}
catch (Exception e)
{
LoggerHelper.warning("No resource bundle found: " + Constants.exceptionResourceBundle, e);
bundle = null;
}
System.out.println("key=backup-res.BadProjectBackupDir, value =" + get("backup-res.BadProjectBackupDir"));
|
|