AdminLocalStringsManagerpublic class AdminLocalStringsManager extends LocalStringsManager Implementation of a Admin local string manager as Admin-specific wrapper around LocalStringsManager;
Provides access to i18n messages for classes that need them.
This particular implementation presents the following resources organization:
- 1. Resource files share locations with sources (same directories);
- 2. Base directory is "com.sun.enterprise.admin";
- 3. Search ONLY in first resource bundle, which found on the way up to basePackage( No additional hiearchical search of value if it is not found in that file)
|
Fields Summary |
---|
static final String | ADMIN_BASE_PACKAGE | static final String | DEFAULT_PROPERTY_FILE_NAME | public static final String | MESSAGESMessages Property File Type (file name prefix) | public static final String | DESCRIPTIONSDecriptions Property File Type (file name prefix) |
Constructors Summary |
---|
public AdminLocalStringsManager(Object callerObject)Create a string manager that looks for default type properties(MESSAGES) in
the package of the callerObject or parent Admin packages.
this(callerObject, DEFAULT_PROPERTY_FILE_NAME);
| public AdminLocalStringsManager(Object callerObject, String propertyFileName)Create a string manager that looks for -propertyFileName-.properties in
the package of the callerObject or parent Admin packages;
It's supposed that propertyFileName should be one of well-known names,
defined by constants: MESSAGES/DESCRIPTIONS/NOTIFICATIONS etc.
super(ADMIN_BASE_PACKAGE, propertyFileName);
String callerClassPath;
if(callerObject==null)
callerClassPath = ADMIN_BASE_PACKAGE; //reffer to base
else
{
callerClassPath = callerObject.getClass().getName();
callerClassPath = callerClassPath.substring(0, callerClassPath.lastIndexOf('."));
}
setFixedResourceBundle(callerClassPath);
|
Methods Summary |
---|
public static com.sun.enterprise.admin.util.AdminLocalStringsManager | createDescriptionsManager(java.lang.Object callerObject)Convenient Factory class for obtaining a Admin string manager for description type strings.
return new AdminLocalStringsManager(callerObject, DESCRIPTIONS);
| public static com.sun.enterprise.admin.util.AdminLocalStringsManager | createMessagesManager(java.lang.Object callerObject)Convenient Factory class for obtaining a Admin string manager for message type strings.
return new AdminLocalStringsManager(callerObject, MESSAGES);
| public java.lang.String | getString(java.lang.String key, java.lang.String defaultValue)Get a localized string.
return super.getString(key, defaultValue);
| public java.lang.String | getString(java.lang.String key, java.lang.String defaultFormat, java.lang.Object[] args)Get a local string and format the arguments accordingly.
return super.getString(key, defaultFormat, args);
| public java.lang.String | getString(java.lang.String key, java.lang.String defaultFormat, java.lang.Object arg1)Convenience method - getString() overriding for fixed number of formatting arguments.
return getString(key, defaultFormat, (new Object[]{arg1}));
| public java.lang.String | getString(java.lang.String key, java.lang.String defaultFormat, java.lang.Object arg1, java.lang.Object arg2)Convenience method - getString() overriding for fixed number of formatting arguments.
return getString(key, defaultFormat, (new Object[]{arg1, arg2}));
| public java.lang.String | getString(java.lang.String key, java.lang.String defaultFormat, java.lang.Object arg1, java.lang.Object arg2, java.lang.Object arg3)Convenience method - getString() overriding for fixed number of formatting arguments.
return getString(key, defaultFormat, (new Object[]{arg1, arg2, arg3}));
|
|