It uses the resource bundle mechanism for locating messages based on keys; the preferred form of resource bundle is a property file mapping keys to messages.
| Modifier and Type | Field and Description |
|---|---|
| private static final String | |
| private static final Locale | |
| private static BundleFinder | |
| private static final String | |
| private static final String | |
| private static final String | |
| private static final String |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static String | |
| private static ResourceBundle | |
| private static ResourceBundle | |
| public static ResourceBundle | |
| public static ResourceBundle | Returns: the best message bundle to localize the messagesThe name of the message resource resource, Locale The preferred locale locale)Method to use instead of ResourceBundle.getBundle(). |
| private static PropertyResourceBundle | Returns: the corresponding resource bundleThe name of the resource resourceName, final Module The module where it lives module)Get a resource bundle from a module. |
| public static String | Returns: the resulting new property nameThe handle on the message messageId, String The property to append propertyName)Append a property name onto the end of a message |
| public static String | Returns: the text for the message with arguments plugged inThe message handle messageId, Object... The arguments to the message arguments)Transform the message from messageID to the actual error, warning, or info message using the correct locale. |
| public static int | Returns: the corresponding hashA key to hash key)Hash function to split messages into 50 files based upon the message identifier or SQLState. |
| private static String | localizeResourceName(String original, String localeName)
Add a directory level named locale_xx_YY to the resource name if it is not the clientmessages resource bundle. |
| private static ResourceBundle | |
| public static ResourceBundle | |
| private static ResourceBundle | lookupBundleInModule(Module messageModule, String resource, String localeSuffix, boolean useEnglish, boolean useEngineModule)
Lookup a message in a given module |
| public static void |
| CLIENT_MESSAGES | back to summary |
|---|---|
| private static final String CLIENT_MESSAGES | |
| EN | back to summary |
|---|---|
| private static final Locale EN | |
| finder | back to summary |
|---|---|
| private static BundleFinder finder | |
| LOCALE_STUB | back to summary |
|---|---|
| private static final String LOCALE_STUB | |
| SERVER_MESSAGES | back to summary |
|---|---|
| private static final String SERVER_MESSAGES | |
| SYSINFO_MESSAGES | back to summary |
|---|---|
| private static final String SYSINFO_MESSAGES | |
| TOOLS_MESSAGES | back to summary |
|---|---|
| private static final String TOOLS_MESSAGES | |
| MessageService | back to summary |
|---|---|
| private MessageService() | |
| formatMessage | back to summary |
|---|---|
| public static String formatMessage(ResourceBundle bundle, String messageId, Object[] arguments, boolean lastChance) | |
| getBundle | back to summary |
|---|---|
| private static ResourceBundle getBundle(String messageId) | |
| getBundle | back to summary |
|---|---|
| private static ResourceBundle getBundle(String resource, Locale locale) Look up a bundle in the correct package. Returns null if the bundle can't be found. | |
| getBundleForLocale | back to summary |
|---|---|
| public static ResourceBundle getBundleForLocale(Locale locale, String msgId) | |
| getBundleWithEnDefault | back to summary |
|---|---|
| public static ResourceBundle getBundleWithEnDefault(String resource, Locale locale) Method to use instead of ResourceBundle.getBundle(). This method acts like ResourceBundle.getBundle() but if the resource is not available in the requested locale, default locale or base class the one for en_US is returned.
| |
| getModuleResourceBundle | back to summary |
|---|---|
| private static PropertyResourceBundle getModuleResourceBundle(final String resourceName, final Module module) Get a resource bundle from a module.
| |
| getProperty | back to summary |
|---|---|
| public static String getProperty(String messageId, String propertyName) Append a property name onto the end of a message | |
| getTextMessage | back to summary |
|---|---|
| public static String getTextMessage(String messageId, Object... arguments) Transform the message from messageID to the actual error, warning, or info message using the correct locale. The arguments to the messages are passed via an object array, the objects in the array WILL be changed by this class. The caller should NOT get the object back from this array. | |
| hashString50 | back to summary |
|---|---|
| public static int hashString50(String key) Hash function to split messages into 50 files based upon the message identifier or SQLState. We don't use String.hashCode() as it varies between releases and doesn't provide an even distribution across the 50 files.
| |
| localizeResourceName | back to summary |
|---|---|
| private static String localizeResourceName(String original, String localeName) Add a directory level named locale_xx_YY to the resource name if it is not the clientmessages resource bundle. So, for instance, "org.apache.derby.loc.tools.toolsmessages" becomes "org.apache.derby.loc.tools.locale_de_DE.toolsmessages". | |
| lookupBundle | back to summary |
|---|---|
| private static ResourceBundle lookupBundle(String resource, Locale locale) Use the JVM to lookup a ResourceBundle | |
| lookupBundleInModule | back to summary |
|---|---|
| public static ResourceBundle lookupBundleInModule(String resource, Locale locale) Lookup the message in a Jigsaw module. | |
| lookupBundleInModule | back to summary |
|---|---|
| private static ResourceBundle lookupBundleInModule(Module messageModule, String resource, String localeSuffix, boolean useEnglish, boolean useEngineModule) Lookup a message in a given module | |
| setFinder | back to summary |
|---|---|
| public static void setFinder(BundleFinder theFinder) | |