Java Doc for LocalizationService.java in  » Web-Framework » TURBINE » org » apache » turbine » services » localization » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Web Framework » TURBINE » org.apache.turbine.services.localization 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


org.apache.turbine.services.localization.LocalizationService

All known Subclasses:   org.apache.turbine.services.localization.TurbineLocalizationService,
LocalizationService
public interface LocalizationService extends Service(Code)

Provides localization functionality using the interface provided by ResourceBundle, plus leverages a "search path" style traversal of the ResourceBundle objects named by the locale.default.bundles to discover a value for a given key.

It is suggested that one handle dealing with concatenated messages using MessageFormat and properties files.


author:
   Jon S. Stevens
author:
   Daniel Rall
author:
   Leonard Richardson
version:
   $Id: LocalizationService.java 534527 2007-05-02 16:10:59Z tv $


Field Summary
 StringACCEPT_LANGUAGE
     A constant for the HTTP Accept-Language header.
 StringSERVICE_NAME
     The name of this service.


Method Summary
 Stringformat(String bundleName, Locale locale, String key, Object arg1)
     Formats a localized value using the provided object.
Parameters:
  bundleName - The bundle in which to look for the localizable text.
Parameters:
  locale - The locale for which to format the text.
Parameters:
  key - The identifier for the localized text to retrieve,
Parameters:
  arg1 - The object to use as {0} when formatting the localized text.
 Stringformat(String bundleName, Locale locale, String key, Object arg1, Object arg2)
     Formats a localized value using the provided objects.
Parameters:
  bundleName - The bundle in which to look for the localizable text.
Parameters:
  locale - The locale for which to format the text.
Parameters:
  key - The identifier for the localized text to retrieve,
Parameters:
  arg1 - The object to use as {0} when formatting the localized text.
Parameters:
  arg2 - The object to use as {1} when formatting the localized text.
 Stringformat(String bundleName, Locale locale, String key, Object[] args)
     Formats a localized value using the provided objects.
Parameters:
  bundleName - The bundle in which to look for the localizable text.
Parameters:
  locale - The locale for which to format the text.
Parameters:
  key - The identifier for the localized text to retrieve,
Parameters:
  args - The objects to use as {0}, {1}, etc.
 ResourceBundlegetBundle()
     Convenience method to get a default ResourceBundle.
 ResourceBundlegetBundle(String bundleName)
     Returns a ResourceBundle given the bundle name and the default locale information supplied by the configuration.
Parameters:
  bundleName - Name of bundle.
 ResourceBundlegetBundle(String bundleName, String languageHeader)
     Convenience method to get a ResourceBundle based on name and HTTP Accept-Language header.
Parameters:
  bundleName - Name of bundle.
Parameters:
  languageHeader - A String with the language header.
 ResourceBundlegetBundle(HttpServletRequest req)
     Convenience method to get a ResourceBundle based on HTTP Accept-Language header in HttpServletRequest.
Parameters:
  req - The HTTP request to parse theAccept-Language of.
 ResourceBundlegetBundle(String bundleName, HttpServletRequest req)
     Convenience method to get a ResourceBundle based on name and HTTP Accept-Language header in HttpServletRequest.
Parameters:
  bundleName - Name of bundle.
Parameters:
  req - The HTTP request to parse theAccept-Language of.
 ResourceBundlegetBundle(String bundleName, Locale locale)
     Convenience method to get a ResourceBundle based on name and Locale.
Parameters:
  bundleName - Name of bundle.
Parameters:
  locale - A Locale.
 String[]getBundleNames()
     Retrieves the list of names of bundles to search by default for ResourceBundle keys (as specified in the config file).
 StringgetDefaultBundleName()
     Retrieves the name of the default bundle (as specified in the config file), or the first in the list if there are more than one.
 StringgetDefaultCountry()
     Retrieves the default country (as specified in the config file).
 StringgetDefaultLanguage()
     Retrieves the default language (as specified in the config file).
 LocalegetLocale(HttpServletRequest req)
     Attempts to pull the Accept-Language header out of the HttpServletRequest object and then parse it. If the header is not present, it will return a null Locale.
Parameters:
  req - The HTTP request to parse theAccept-Language of.
 LocalegetLocale(String languageHeader)
     This method parses the Accept-Language header and attempts to create a Locale out of it.
Parameters:
  languageHeader - The Accept-Language HTTPheader.
 StringgetString(String bundleName, Locale locale, String key)
     Tries very hard to return a value, looking first in the specified bundle, then searching list of default bundles (giving precedence to earlier bundles over later bundles).
Parameters:
  bundleName - Name of the bundle to look in first.
Parameters:
  locale - Locale to get text for.
Parameters:
  key - Name of the text to retrieve.
 voidsetBundle(String defaultBundle)
     This method sets the name of the defaultBundle.

Field Detail
ACCEPT_LANGUAGE
String ACCEPT_LANGUAGE(Code)
A constant for the HTTP Accept-Language header.



SERVICE_NAME
String SERVICE_NAME(Code)
The name of this service.





Method Detail
format
String format(String bundleName, Locale locale, String key, Object arg1)(Code)
Formats a localized value using the provided object.
Parameters:
  bundleName - The bundle in which to look for the localizable text.
Parameters:
  locale - The locale for which to format the text.
Parameters:
  key - The identifier for the localized text to retrieve,
Parameters:
  arg1 - The object to use as {0} when formatting the localized text. Formatted localized text.
See Also:   LocalizationService.format(String,Locale,String,Object[])



format
String format(String bundleName, Locale locale, String key, Object arg1, Object arg2)(Code)
Formats a localized value using the provided objects.
Parameters:
  bundleName - The bundle in which to look for the localizable text.
Parameters:
  locale - The locale for which to format the text.
Parameters:
  key - The identifier for the localized text to retrieve,
Parameters:
  arg1 - The object to use as {0} when formatting the localized text.
Parameters:
  arg2 - The object to use as {1} when formatting the localized text. Formatted localized text.
See Also:   LocalizationService.format(String,Locale,String,Object[])



format
String format(String bundleName, Locale locale, String key, Object[] args)(Code)
Formats a localized value using the provided objects.
Parameters:
  bundleName - The bundle in which to look for the localizable text.
Parameters:
  locale - The locale for which to format the text.
Parameters:
  key - The identifier for the localized text to retrieve,
Parameters:
  args - The objects to use as {0}, {1}, etc. whenformatting the localized text. Formatted localized text.



getBundle
ResourceBundle getBundle()(Code)
Convenience method to get a default ResourceBundle. A localized ResourceBundle.



getBundle
ResourceBundle getBundle(String bundleName)(Code)
Returns a ResourceBundle given the bundle name and the default locale information supplied by the configuration.
Parameters:
  bundleName - Name of bundle. A localized ResourceBundle.



getBundle
ResourceBundle getBundle(String bundleName, String languageHeader)(Code)
Convenience method to get a ResourceBundle based on name and HTTP Accept-Language header.
Parameters:
  bundleName - Name of bundle.
Parameters:
  languageHeader - A String with the language header. A localized ResourceBundle.



getBundle
ResourceBundle getBundle(HttpServletRequest req)(Code)
Convenience method to get a ResourceBundle based on HTTP Accept-Language header in HttpServletRequest.
Parameters:
  req - The HTTP request to parse theAccept-Language of. A localized ResourceBundle.



getBundle
ResourceBundle getBundle(String bundleName, HttpServletRequest req)(Code)
Convenience method to get a ResourceBundle based on name and HTTP Accept-Language header in HttpServletRequest.
Parameters:
  bundleName - Name of bundle.
Parameters:
  req - The HTTP request to parse theAccept-Language of. A localized ResourceBundle.



getBundle
ResourceBundle getBundle(String bundleName, Locale locale)(Code)
Convenience method to get a ResourceBundle based on name and Locale.
Parameters:
  bundleName - Name of bundle.
Parameters:
  locale - A Locale. A localized ResourceBundle.



getBundleNames
String[] getBundleNames()(Code)
Retrieves the list of names of bundles to search by default for ResourceBundle keys (as specified in the config file). The list of configured bundle names.



getDefaultBundleName
String getDefaultBundleName()(Code)
Retrieves the name of the default bundle (as specified in the config file), or the first in the list if there are more than one.



getDefaultCountry
String getDefaultCountry()(Code)
Retrieves the default country (as specified in the config file).



getDefaultLanguage
String getDefaultLanguage()(Code)
Retrieves the default language (as specified in the config file).



getLocale
Locale getLocale(HttpServletRequest req)(Code)
Attempts to pull the Accept-Language header out of the HttpServletRequest object and then parse it. If the header is not present, it will return a null Locale.
Parameters:
  req - The HTTP request to parse theAccept-Language of. The parsed locale.



getLocale
Locale getLocale(String languageHeader)(Code)
This method parses the Accept-Language header and attempts to create a Locale out of it.
Parameters:
  languageHeader - The Accept-Language HTTPheader. The parsed locale.



getString
String getString(String bundleName, Locale locale, String key)(Code)
Tries very hard to return a value, looking first in the specified bundle, then searching list of default bundles (giving precedence to earlier bundles over later bundles).
Parameters:
  bundleName - Name of the bundle to look in first.
Parameters:
  locale - Locale to get text for.
Parameters:
  key - Name of the text to retrieve. Localized text.



setBundle
void setBundle(String defaultBundle)(Code)
This method sets the name of the defaultBundle.
Parameters:
  defaultBundle - Name of default bundle.



www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.