Java Servlets Application Hosting Web Hosting, website hosting, web site hosting , web page hosting Apache, PHP, MySQL, PERL, servlets Java, JSP  Java Servlets Application Hosting Web Hosting website hosting, web site hosting, web page hosting Apache, PHP, MySQL, PERL, servlets Java, JSP,Python Java Servlets Application Hosting Web Hosting website hosting, web site hosting, web page hosting Apache, PHP, MySQL, PERL, servlets Java, JSP,Python Java Servlets Application Hosting Web Hosting website hosting, web site hosting, web page hosting Apache, PHP, MySQL, PERL, servlets Java, JSP,Python Java Servlets Application Hosting Web Hosting website hosting, web site hosting, web page hosting, Apache, PHP, MySQL, PERL, servlets Java, JSP,Python
Java Servlets Application Hosting Web Hosting, website hosting, web site hosting, web page hosting, Apache, PHP, MySQL, PERL, servlets Java, JSP, Python Java Servlets Application Hosting Web Hosting, website hosting, web site hosting, web page hosting, Apache, PHP, MySQL, PERL, servlets Java, Python,JSP
Java Servlets Application Hosting Web Hosting Sign-Up Java Servlets Application Hosting Fund Raising, Fundraising, web hosting, website hosting, web site hosting  Java Servlets Application Hosting Resellers web hosting, website hosting, web site hosting Java Servlets Application Hosting EZ Site Control Panel for web hosting,website hosting, web site hosting
Java Servlets Application Hosting Web Hosting, website hosting, web site hosting , web page hosting Apache, PHP, MySQL, PERL, servlets Java, Python,JSP,  Fundraising
Java Servlets Application Hosting Fund Raising, Fundraising, web hosting, website hosting, web site hosting
WWW.

Call Us Toll-Free
(877) 256-0328

Outside USA
1 - (201) 505-0430

Java Servlets Application Hosting Welcome Java Servlets Application Hosting Web Hosting Plans Overview , Fund Raising, Fundraising, web hosting, website hosting, web site hosting Java Servlets Application Hosting Fund Raising, Fundraising, web hosting Java Servlets Application Hosting Resellers, web Hosting Java Servlets Application Hosting Web Design, web Hosting Java Servlets Application Hosting Extra Services,  web Hosting Java Servlets Application Hosting Traffic Booster, web hosting Java Servlets Application Hosting Traffic Booster, web hosting Java Servlets Application Hosting Technical Support,  web Hosting Java Servlets Application Hosting webmaster tips,  web Hosting Java Servlets Application Hosting 30 Day Money Back, web hosting Java Servlets Application Hosting Legal Notices for Web Hosting Java Servlets Application Hosting Glossary Computer Terms for web Hosting Java Servlets Application Hosting Contact Information - web hosting

Site Map
Java Servlets Application Hosting Web Hosting, website hosting, web site hosting , web page hosting Apache, PHP, MySQL, PERL, servlets Java, Python, JSP Java Servlets Application Hosting Java Servlets Application Hosting Java Servlets Application Hosting Java Servlets Application Hosting Java Servlets Application Hosting Locale-Sensitive Services SPI (The Java™ Tutorials > Internationalization > Setting the Locale)
Trail: Internationalization
Lesson: Setting the Locale
Home Page > Internationalization > Setting the Locale
Locale-Sensitive Services SPI

This feature enables the plug-in of locale-dependent data and services. In this way, third parties are able to provide implementations of most locale-sensitive classes in the java.text and java.util packages.

The implementation of SPIs (Service Provider Interface) is based on abstract classes and Java interfaces that are implemented by the service provider. At runtime the Java class loading mechanism is used to dynamically locate and load classes that implement the SPI.

You can use the locale-sensitive services SPI to provide the following locale sensitive implementations:

  • BreakIterator objects
  • Collator objects
  • Language code, Country code, and Variant name for the Locale class
  • Time Zone names
  • Currency symbols
  • DateFormat objects
  • DateFormatSymbol objects
  • NumberFormat objects
  • DecimalFormatSymbols objects
The corresponding SPIs are contained both in java.text.spi and in java.util.spi packages:

java.util.spi java.text.spi
  • CurrencyNameProvider
  • LocaleServiceProvider
  • TimeZoneNameProvider
  • BreakIteratorProvider
  • CollatorProvider
  • DateFormatProvider
  • DateFormatSymbolsProvider
  • DecimalFormatSymbolsProvider
  • NumberFormatProvider

For example, if you would like to provide a NumberFormat object for a new locale, you have to implement the java.text.spi.NumberFormatProvider class. You need to extend this class and implement its methods:

  • getCurrencyInstance(Locale locale)
  • getIntegerInstance(Locale locale)
  • getNumberInstance(Locale locale)
  • getPercentInstance(Locale locale)
  Locale loc = new Locale("da", "DK");
  NumberFormat nf = NumberFormatProvider.getNumberInstance(loc);

These methods first check whether the Java runtime environment supports the requested locale; if so, they use that support. Otherwise, the methods call the getAvailableLocales() methods of installed providers for the appropriate interface to find a provider that supports the requested locale.

Previous page: The Scope of a Locale
Next page: Isolating Locale-Specific Data
 
 
 

Add to My Yahoo!

XML icon

Add to Google

 

 

 

 

 

 

 

 

 

 

 

JSP Servlets Tomcat mysql Java JSP Servlets Tomcat mysql Java JSP Servlets Tomcat mysql Java JSP Servlets Tomcat mysql Java JSP at JSP.aldenWEBhosting.com Servlets at servlets.aldenWEBhosting.com Tomcat at Tomcat.aldenWEBhosting.com mysql at mysql.aldenWEBhosting.com Java at Java.aldenWEBhosting.com Web Hosts Portal Web Links Web Links Web Hosting JSP Solutions Web Links JSP Solutions Web Hosting Servlets Solutions Web Links Servlets Solutions Web Hosting Web Links Web Links . . .
.
.
. .
.
. .
. . . . . . . . . . . jsp hosting servlets hosting web hosting web sites designed cheap web hosting web site hosting myspace web hosting