< prev index next >

src/java.base/share/classes/java/util/spi/ResourceBundleControlProvider.java

Print this page
rev 16336 : [mq]: 8171189


  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 package java.util.spi;
  27 
  28 import java.util.ResourceBundle;
  29 
  30 /**
  31  * An interface for service providers that provide implementations of {@link
  32  * java.util.ResourceBundle.Control}. The <a
  33  * href="../ResourceBundle.html#default_behavior">default resource bundle loading
  34  * behavior</a> of the {@code ResourceBundle.getBundle} factory methods that take
  35  * no {@link java.util.ResourceBundle.Control} instance can be modified with {@code
  36  * ResourceBundleControlProvider} implementations.
  37  *
  38  * <p>Provider implementations must be packaged using the <a
  39  * href="../../../../technotes/guides/extensions/index.html">Java Extension
  40  * Mechanism</a> as installed extensions. Refer to {@link java.util.ServiceLoader}
  41  * for the extension packaging. Any installed {@code
  42  * ResourceBundleControlProvider} implementations are loaded using {@link
  43  * java.util.ServiceLoader} at the {@code ResourceBundle} class loading time.
  44  *
  45  * <p>All {@code ResourceBundleControlProvider}s are ignored in named modules.
  46  *
  47  * @author Masayoshi Okutsu
  48  * @since 1.8
  49  * @see ResourceBundle#getBundle(String, java.util.Locale, ClassLoader, ResourceBundle.Control)
  50  *      ResourceBundle.getBundle
  51  * @see java.util.ServiceLoader#loadInstalled(Class)






  52  */

  53 public interface ResourceBundleControlProvider {
  54     /**
  55      * Returns a {@code ResourceBundle.Control} instance that is used
  56      * to handle resource bundle loading for the given {@code
  57      * baseName}. This method must return {@code null} if the given
  58      * {@code baseName} isn't handled by this provider.
  59      *
  60      * @param baseName the base name of the resource bundle
  61      * @return a {@code ResourceBundle.Control} instance,
  62      *         or {@code null} if the given {@code baseName} is not
  63      *         applicable to this provider.
  64      * @throws NullPointerException if {@code baseName} is {@code null}
  65      */
  66     public ResourceBundle.Control getControl(String baseName);
  67 }


  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 package java.util.spi;
  27 
  28 import java.util.ResourceBundle;
  29 
  30 /**
  31  * An interface for service providers that provide implementations of {@link
  32  * java.util.ResourceBundle.Control}. The <a
  33  * href="../ResourceBundle.html#default_behavior">default resource bundle loading
  34  * behavior</a> of the {@code ResourceBundle.getBundle} factory methods that take
  35  * no {@link java.util.ResourceBundle.Control} instance can be modified with {@code
  36  * ResourceBundleControlProvider} implementations.
  37  *









  38  * @author Masayoshi Okutsu
  39  * @since 1.8
  40  * @see ResourceBundle#getBundle(String, java.util.Locale, ClassLoader, ResourceBundle.Control)
  41  *      ResourceBundle.getBundle
  42  * @see java.util.ServiceLoader#loadInstalled(Class)
  43  * @deprecated There is no longer any mechanism to install a custom
  44  * {@code ResourceBundleControlProvider} implementation defined
  45  * by the platform class loader or its ancestor. The recommended
  46  * way to use a custom {@code Control} implementation to load resource bundle
  47  * is to use {@link java.util.ResourceBundle#getBundle(String, Control)}
  48  * or other factory methods that take custom {@link java.util.ResourceBundle.Control}.
  49  */
  50 @Deprecated(since="9", forRemoval=true)
  51 public interface ResourceBundleControlProvider {
  52     /**
  53      * Returns a {@code ResourceBundle.Control} instance that is used
  54      * to handle resource bundle loading for the given {@code
  55      * baseName}. This method must return {@code null} if the given
  56      * {@code baseName} isn't handled by this provider.
  57      *
  58      * @param baseName the base name of the resource bundle
  59      * @return a {@code ResourceBundle.Control} instance,
  60      *         or {@code null} if the given {@code baseName} is not
  61      *         applicable to this provider.
  62      * @throws NullPointerException if {@code baseName} is {@code null}
  63      */
  64     public ResourceBundle.Control getControl(String baseName);
  65 }
< prev index next >