Java Doc for ScarabLocalizationTool.java in  » Issue-Tracking » scarab-0.21 » org » tigris » scarab » tools » 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 » Issue Tracking » scarab 0.21 » org.tigris.scarab.tools 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


org.tigris.scarab.tools.ScarabLocalizationTool

All known Subclasses:   org.tigris.scarab.test.mocks.MockScarabLocalizationTool,
ScarabLocalizationTool
public class ScarabLocalizationTool extends LocalizationTool (Code)
Scarab-specific localiztion tool. Uses a specific property format to map a generic i10n key to a specific screen. For example, the $i10n.title on the screen: admin/AddPermission.vm would be in ScarabBundle_en.properties
 admin/AddPermission.vm.Title
 

author:
   Daniel Rall
author:
   Eric Pugh


Field Summary
public static  LocaleDEFAULT_LOCALE
     The Locale to be used, if the Resource could not be found in one of the Locales specified in the Browser's language preferences.

Constructor Summary
public  ScarabLocalizationTool()
     Creates a new instance.

Method Summary
protected  StringfindProperty(String property)
     Retrieves the localized version of the value of property.
Parameters:
  property - The name of the property whose value to retrieve.
public  Stringformat(String key, Object arg1)
     Formats a localized value using the provided object.
Parameters:
  key - The identifier for the localized text to retrieve,
Parameters:
  arg1 - The object to use as {0} when formatting the localized text.
public  Stringformat(String key, Object arg1, Object arg2)
     Formats a localized value using the provided objects.
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  Stringformat(String key, Object arg1, Object arg2, Object arg3)
     Formats a localized value using the provided objects.
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.
Parameters:
  arg3 - The object to use as {2} when formatting the localized text.
public  Stringformat(String key, List args)
    

Formats a localized value using the provided objects.

ResourceBundle:

 VelocityUsersNotWrong={0} out of {1} users can't be wrong!
 
Template:
 $l10n.format("VelocityUsersNotWrong", ["9", "10"])
 
Result:
 9 out of 10 Velocity users can't be wrong!
 


Parameters:
  key - The identifier for the localized text to retrieve,
Parameters:
  args - The objects to use as {0}, {1}, etc.
public  Stringformat(String key, Object[] args)
     Formats a localized value using the provided objects. Take into account the Browser settings (in order of preference), the Turbine default settings and the System Locale, if the Turbine Default Locale is not defined.
Parameters:
  key - The identifier for the localized text to retrieve,
Parameters:
  args - The MessageFormat data used when formattingthe localized text.
public  Stringget(Localizable key)
     Return the localized property value.
public  Stringget(String key)
     Return the localized property value.
protected  StringgetBundleName()
    
public  StringgetIgnoreMissingResource(String key)
     Return the localized property value.
public  StringgetMessage(Throwable t)
     Extract a message from an exception.
public  LocalegetPrimaryLocale()
     Gets the primary locale.
public  StringgetTitle()
     Provides $l10n.Title to templates, grabbing it from the title property for the current template.
public  voidinit(Object obj)
     Initialize the tool.
public  booleanisFilterEnabled()
     Whether our cross-site scripting filter is enabled.
public  voidrefresh()
     Reset this instance to initial values.
public  voidrestoreBundlePrefix()
     Restore the old Bundle Prefix to it's previous value.
public  voidsetBundlePrefix(String prefix)
     Change the BundlePrefix.
public  voidsetFilterEnabled(boolean v)
     Allow us to be able to enable/disable our cross-site scripting filter when rendering something from the format() method.

Field Detail
DEFAULT_LOCALE
public static Locale DEFAULT_LOCALE(Code)
The Locale to be used, if the Resource could not be found in one of the Locales specified in the Browser's language preferences.




Constructor Detail
ScarabLocalizationTool
public ScarabLocalizationTool()(Code)
Creates a new instance. Client should ScarabLocalizationTool.init(Object) initialize the instance.




Method Detail
findProperty
protected String findProperty(String property)(Code)
Retrieves the localized version of the value of property.
Parameters:
  property - The name of the property whose value to retrieve. The localized property value.



format
public String format(String key, Object arg1)(Code)
Formats a localized value using the provided object.
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:   ScarabLocalizationTool.format(String,List)



format
public String format(String key, Object arg1, Object arg2)(Code)
Formats a localized value using the provided objects.
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:   ScarabLocalizationTool.format(String,List)



format
public String format(String key, Object arg1, Object arg2, Object arg3)(Code)
Formats a localized value using the provided objects.
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.
Parameters:
  arg3 - The object to use as {2} when formatting the localized text. Formatted localized text.
See Also:   ScarabLocalizationTool.format(String,List)



format
public String format(String key, List args)(Code)

Formats a localized value using the provided objects.

ResourceBundle:

 VelocityUsersNotWrong={0} out of {1} users can't be wrong!
 
Template:
 $l10n.format("VelocityUsersNotWrong", ["9", "10"])
 
Result:
 9 out of 10 Velocity users can't be wrong!
 


Parameters:
  key - The identifier for the localized text to retrieve,
Parameters:
  args - The objects to use as {0}, {1}, etc. when formatting thelocalized text. Formatted localized text.



format
public String format(String key, Object[] args)(Code)
Formats a localized value using the provided objects. Take into account the Browser settings (in order of preference), the Turbine default settings and the System Locale, if the Turbine Default Locale is not defined.
Parameters:
  key - The identifier for the localized text to retrieve,
Parameters:
  args - The MessageFormat data used when formattingthe localized text. Formatted localized text.
See Also:   ScarabLocalizationTool.format(String,List)



get
public String get(Localizable key)(Code)
Return the localized property value. Take into account the Browser settings (in order of preference), the Turbine default settings and the System Locale, if the Turbine Default Locale is not defined.



get
public String get(String key)(Code)
Return the localized property value. Take into account the Browser settings (in order of preference), the Turbine default settings and the System Locale, if the Turbine Default Locale is not defined. NOTE: Please don't use this method from the Java-code. It is intended for use with Velocity only! ScarabLocalizationTool.get(LocalizationKey)



getBundleName
protected String getBundleName()(Code)
Get the default ResourceBundle name



getIgnoreMissingResource
public String getIgnoreMissingResource(String key)(Code)
Return the localized property value. Take into account the Browser settings (in order of preference), the Turbine default settings and the System Locale, if the Turbine Default Locale is not defined. NOTE: Please don't use this method from the Java-code. It is intended for use with Velocity only! ScarabLocalizationTool.get(LocalizationKey)



getMessage
public String getMessage(Throwable t)(Code)
Extract a message from an exception. This method checks, if the exception is Localizable. If so, we now can retrieve the localized exception message. Otherwise we retrieve the standard message via e.getLocalizedMessage().
Parameters:
  e - throws NullPointerException if t is null



getPrimaryLocale
public Locale getPrimaryLocale()(Code)
Gets the primary locale. The primary locale is the locale which will be choosen at first from the set of Locales which are accepted by the user as defined on the Browser language preferrences. The primary locale currently in use.



getTitle
public String getTitle()(Code)
Provides $l10n.Title to templates, grabbing it from the title property for the current template. The title for the template used in the current request, ornull if title property was not found inthe available resource bundles.



init
public void init(Object obj)(Code)
Initialize the tool. Within the turbine pull service this tool is initialized with a RunData. However, the tool can also be initialized with a Locale.



isFilterEnabled
public boolean isFilterEnabled()(Code)
Whether our cross-site scripting filter is enabled.



refresh
public void refresh()(Code)
Reset this instance to initial values. Probably needed for reuse of ScarabLocalizationTool Instances.



restoreBundlePrefix
public void restoreBundlePrefix()(Code)
Restore the old Bundle Prefix to it's previous value.



setBundlePrefix
public void setBundlePrefix(String prefix)(Code)
Change the BundlePrefix. Keep the original value for later restore
Parameters:
  prefix -



setFilterEnabled
public void setFilterEnabled(boolean v)(Code)
Allow us to be able to enable/disable our cross-site scripting filter when rendering something from the format() method. The default is to have it enabled.



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