Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK
11g Release 2 (11.1.2.2.0)

E17493-03


oracle.javatools.util
Class BundleLoader

java.lang.Object
  extended by oracle.javatools.util.BundleLoader


public class BundleLoader
extends java.lang.Object

By default the strategy for fetching resource bundles requires a large number of class and resource fetches; the method ResourceBundle.getBundle(String,Locale,ClassLoader) gives precise details. Many of these are speculative - the fetch frequently fails - and this imposes a significant overhead for any resource bundle fetch. For example, it is unusual for translations specific to American and British English to exist so there are rarely bundles suffixed with 'en_US' or 'en_GB'. In fact often 'en' does not exist as the base resource is English. For a large number of resources the set of translated locales is a given. The BundleLoader takes advantage of this knowledge to minimise speculative searches for the default locale. Setting the System property oracle.translated.locales to a comma separated list of locales, eg oracle.translated.locales=ja,fr_CA, specifies the available translations. The BundleLoader uses this list to determine which extant locale should be used as the default.


Constructor Summary
BundleLoader(java.util.Locale locale, java.lang.String inclusionList)
          Constructs a BundleLoader that maps locale to a restricted one given the inclusionList.

 

Method Summary
static java.util.ResourceBundle getBundle(java.lang.String baseName)
          Deprecated. Although this method will now use the calling classloader, it is using a non-public sun.* API to achieve this. This might not exist on a different Java VM, so ultimately these calls need to be removed.
static java.util.ResourceBundle getBundle(java.lang.String baseName, java.lang.ClassLoader loader)
          Gets a resource bundle using the 'default' locale and the supplied class loader.

 

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Constructor Detail

BundleLoader

public BundleLoader(java.util.Locale locale,
                    java.lang.String inclusionList)
Constructs a BundleLoader that maps locale to a restricted one given the inclusionList.
Parameters:
locale - locale to map, must not be null
inclusionList - comma separated list of available locales or null for no restrictions

Method Detail

getBundle

public static final java.util.ResourceBundle getBundle(java.lang.String baseName)
Deprecated. Although this method will now use the calling classloader, it is using a non-public sun.* API to achieve this. This might not exist on a different Java VM, so ultimately these calls need to be removed.
Gets a resource bundle using the 'default' locale and the class loader for the calling class.
See Also:
ResourceBundle.getBundle(String)

getBundle

public static final java.util.ResourceBundle getBundle(java.lang.String baseName,
                                                       java.lang.ClassLoader loader)
Gets a resource bundle using the 'default' locale and the supplied class loader. This method should be used if the caller class was loaded by a different class loader than this class.
See Also:
ResourceBundle.getBundle(String,Locale,ClassLoader)

Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK
11g Release 2 (11.1.2.2.0)

E17493-03


Copyright © 1997, 2012, Oracle. All rights reserved.