Java Doc for Localization.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) 


java.lang.Object
   org.apache.turbine.services.localization.Localization

Localization
abstract public class Localization (Code)
Wrapper around the TurbineLocalization Service that makes it easy to grab something from the service and make the code cleaner.

Instead of typing:
((LocalizationService)TurbineServices.getInstance()
.getService(LocalizationService.SERVICE_NAME))
.getBundle(data)
.getString(str)
Now you only need to type:
Localization.getString(str)
author:
   Jon S. Stevens
author:
   Daniel Rall
version:
   $Id: Localization.java 534527 2007-05-02 16:10:59Z tv $





Method Summary
public static  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.
public static  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.
public static  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.
public static  ResourceBundlegetBundle(String bundleName)
     Convenience method to get a ResourceBundle based on name.
Parameters:
  bundleName - Name of bundle.
public static  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.
public static  ResourceBundlegetBundle(HttpServletRequest req)
     Convenience method to get a ResourceBundle based on name and HTTP Accept-Language header in HttpServletRequest.
Parameters:
  req - HttpServletRequest.
public static  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 - HttpServletRequest.
public static  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.
public static  ResourceBundlegetBundle(String bundleName, RunData data)
    
public static  StringgetDefaultBundleName()
    
public static  LocalegetLocale(HttpServletRequest req)
     Attempts to pull the Accept-Language header out of the HttpServletRequest object and then parse it.
public static  LocalegetLocale(String languageHeader)
     This method parses the Accept-Language header and attempts to create a Locale out of it.
Parameters:
  languageHeader - A String with the language header.
final protected static  LocalizationServicegetService()
     Gets the LocalizationService implementation.
public static  StringgetString(String bundleName, Locale locale, String key)
     Fetches the localized text from the specified bundle, ignoring any default bundles.
public static  StringgetString(String key)
     Pulls a string out of the LocalizationService with the default locale values of what is defined in the TurbineResources.properties file for the locale.default.language and locale.default.country property values.
public static  StringgetString(String key, Locale locale)
    
Parameters:
  key - Name of the text to retrieve.
Parameters:
  locale - Locale to get text for.
public static  StringgetString(String key, HttpServletRequest req)
     Pulls a string out of the LocalizationService and attempts to determine the Locale by the Accept-Language header.
public static  StringgetString(String key, String lang)
     Convenience method that pulls a localized string off the LocalizationService using the default ResourceBundle name defined in the TurbineResources.properties file and the specified language name in ISO format.
Parameters:
  key - Name of string.
Parameters:
  lang - Desired language for the localized string.
public static  StringgetString(RunData data, String key)
    
public static  voidsetBundle(String defaultBundle)
     This method sets the name of the default bundle.



Method Detail
format
public static 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:   Localization.format(String,Locale,String,Object[])



format
public static 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:   Localization.format(String,Locale,String,Object[])



format
public static 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
public static ResourceBundle getBundle(String bundleName)(Code)
Convenience method to get a ResourceBundle based on name.
Parameters:
  bundleName - Name of bundle. A localized ResourceBundle.



getBundle
public static 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
public static ResourceBundle getBundle(HttpServletRequest req)(Code)
Convenience method to get a ResourceBundle based on name and HTTP Accept-Language header in HttpServletRequest.
Parameters:
  req - HttpServletRequest. A localized ResourceBundle.



getBundle
public static 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 - HttpServletRequest. A localized ResourceBundle.



getBundle
public static 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.



getBundle
public static ResourceBundle getBundle(String bundleName, RunData data)(Code)



getDefaultBundleName
public static String getDefaultBundleName()(Code)

See Also:   org.apache.turbine.services.localization.LocalizationService.getDefaultBundle



getLocale
public static 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 - HttpServletRequest. A Locale.



getLocale
public static Locale getLocale(String languageHeader)(Code)
This method parses the Accept-Language header and attempts to create a Locale out of it.
Parameters:
  languageHeader - A String with the language header. A Locale.



getService
final protected static LocalizationService getService()(Code)
Gets the LocalizationService implementation. the LocalizationService implementation.



getString
public static String getString(String bundleName, Locale locale, String key)(Code)
Fetches the localized text from the specified bundle, ignoring any default bundles.
See Also:   LocalizationService.getString(StringLocaleString)



getString
public static String getString(String key)(Code)
Pulls a string out of the LocalizationService with the default locale values of what is defined in the TurbineResources.properties file for the locale.default.language and locale.default.country property values. If those cannot be found, then the JVM defaults are used.
Parameters:
  key - Name of string. A localized String.



getString
public static String getString(String key, Locale locale)(Code)

Parameters:
  key - Name of the text to retrieve.
Parameters:
  locale - Locale to get text for. Localized text.



getString
public static String getString(String key, HttpServletRequest req)(Code)
Pulls a string out of the LocalizationService and attempts to determine the Locale by the Accept-Language header. If that header is not present, it will fall back to using the locale values of what is defined in the TurbineResources.properties file for the locale.default.language and locale.default.country property values. If those cannot be found, then the JVM defaults are used.
Parameters:
  req - HttpServletRequest information.
Parameters:
  key - Name of string. A localized String.



getString
public static String getString(String key, String lang)(Code)
Convenience method that pulls a localized string off the LocalizationService using the default ResourceBundle name defined in the TurbineResources.properties file and the specified language name in ISO format.
Parameters:
  key - Name of string.
Parameters:
  lang - Desired language for the localized string. A localized string.



getString
public static String getString(RunData data, String key)(Code)



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



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

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