Java Doc for MessageHelper.java in  » J2EE » Jaffa » org » jaffa » util » 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 » J2EE » Jaffa » org.jaffa.util 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.jaffa.util.MessageHelper

MessageHelper
public class MessageHelper (Code)
This is a helper class for getting messages from the Resource. It also performs token replacement
author:
   GautamJ




Method Summary
public static  StringfindMessage(String key, Object[] args)
     Gets the message for the input key from the default resources, as specified in the 'framework.messageResources.bundle' property of framework.properties files. A null will be returned in case an invalid or if no ResourceBundle is specified in the 'framework.messageResources.bundle' property of framework.properties file. It uses the locale for the user from the thread variable, if available, else it uses the default locale for the JVM. It will also perform token replacement.
public static  StringfindMessage(Locale locale, String key, Object[] args)
     Gets the message for the input key from the default resources, as specified in the 'framework.messageResources.bundle' property of framework.properties files. A null will be returned in case an invalid or if no ResourceBundle is specified in the 'framework.messageResources.bundle' property of framework.properties file. It will also perform token replacement.
public static  StringfindMessage(PageContext pageContext, String key, Object[] args)
     Gets the message for the input key from the resources (an attribute in the request stream).
public static  StringfindMessage(PageContext pageContext, String resources, String locale, String key, Object[] args)
     Gets the message for the input key from the resources (an attribute in the request stream).
public static  StringfindMessage(MessageResources resources, Locale locale, String key, Object[] args)
     Gets the message for the input key from the resources.
public static  booleanhasTokens(String input)
     Returns a true if the input String consists of a tokenized string.
public static  StringremoveTokenMarkers(String input)
     This is a convenience method to remove the token markers from the input string. This method will remove the markers at the beginning and at the end of the string only. Otherwise it'll simply return the input as is.
Parameters:
  input - The string from which the token markers are to be removed.
public static  StringreplaceTokens(String message)
     Replace the tokens in the input message with appropriate values from the default resources, as specified in the 'framework.messageResources.bundle' property of framework.properties files. A null will be returned in case an invalid or if no ResourceBundle is specified in the 'framework.messageResources.bundle' property of framework.properties file. It uses the locale for the user from the thread variable, if available, else it uses the default locale for the JVM. If the value for a token, is again a token, then it will recursively find the value.
Parameters:
  message - Message to be looked up for token replacement.
public static  StringreplaceTokens(Locale locale, String message)
     Replace the tokens in the input message with appropriate values from the default resources, as specified in the 'framework.messageResources.bundle' property of framework.properties files. A null will be returned in case an invalid or if no ResourceBundle is specified in the 'framework.messageResources.bundle' property of framework.properties file. If the value for a token, is again a token, then it will recursively find the value.
Parameters:
  locale - the Locale to be used when looking up the ResourceBundle.
Parameters:
  message - Message to be looked up for token replacement.
public static  StringreplaceTokens(PageContext pageContext, String message)
     Replace the tokens in the input message with appropriate values from the resources (an attribute in the request stream). This uses the default struts MessageResources and Locale. If the value for a token, is again a token, then it will recursively find the value.
Parameters:
  pageContext - The servlet pageContext we are processing.
Parameters:
  message - Message to be looked up for token replacement.
public static  StringreplaceTokens(PageContext pageContext, String resources, String locale, String message)
     Replace the tokens in the input message with appropriate values from the resources (an attribute in the request stream). If the value for a token, is again a token, then it will recursively find the value.
Parameters:
  pageContext - The servlet pageContext we are processing.
Parameters:
  resources - The key that identifies that the MessageResources object in the pageContext
Parameters:
  locale - The key that identifies that the Locale object in the pageContext
Parameters:
  message - Message to be looked up for token replacement.
public static  StringreplaceTokens(MessageResources resources, Locale locale, String message)
     Replace the tokens in the input message with appropriate values from the resources. If the value for a token, is again a token, then it will recursively find the value. Note: Ensure that are no cyclic references from one token to another to the first token.
Parameters:
  resources - The underlying resource bundle to look at.
Parameters:
  locale - The requested message Locale.
Parameters:
  message - Message to be looked up for token replacement.
public static  Stringtokenize(String input)
     This will add the Token Markers around the input String.
Parameters:
  input - the string to be tokenized.



Method Detail
findMessage
public static String findMessage(String key, Object[] args)(Code)
Gets the message for the input key from the default resources, as specified in the 'framework.messageResources.bundle' property of framework.properties files. A null will be returned in case an invalid or if no ResourceBundle is specified in the 'framework.messageResources.bundle' property of framework.properties file. It uses the locale for the user from the thread variable, if available, else it uses the default locale for the JVM. It will also perform token replacement.
Parameters:
  key - The key of the the message to be looked up.
Parameters:
  args - An array of arguments to be added to the message. the message with the tokens replaced.



findMessage
public static String findMessage(Locale locale, String key, Object[] args)(Code)
Gets the message for the input key from the default resources, as specified in the 'framework.messageResources.bundle' property of framework.properties files. A null will be returned in case an invalid or if no ResourceBundle is specified in the 'framework.messageResources.bundle' property of framework.properties file. It will also perform token replacement.
Parameters:
  locale - the Locale to be used when looking up the ResourceBundle.
Parameters:
  key - The key of the the message to be looked up.
Parameters:
  args - An array of arguments to be added to the message. the message with the tokens replaced.



findMessage
public static String findMessage(PageContext pageContext, String key, Object[] args)(Code)
Gets the message for the input key from the resources (an attribute in the request stream). It will also perform token replacement. This uses the default struts MessageResources and Locale.
Parameters:
  pageContext - The servlet pageContext we are processing.
Parameters:
  key - The key of the the message to be looked up.
Parameters:
  args - An array of arguments to be added to the message. the message with the tokens replaced.



findMessage
public static String findMessage(PageContext pageContext, String resources, String locale, String key, Object[] args)(Code)
Gets the message for the input key from the resources (an attribute in the request stream). It will also perform token replacement.
Parameters:
  pageContext - The servlet pageContext we are processing.
Parameters:
  resources - The key that identifies that the MessageResources object in the pageContext
Parameters:
  locale - The key that identifies that the Locale object in the pageContext
Parameters:
  key - The key of the the message to be looked up.
Parameters:
  args - An array of arguments to be added to the message. the message with the tokens replaced.



findMessage
public static String findMessage(MessageResources resources, Locale locale, String key, Object[] args)(Code)
Gets the message for the input key from the resources. It will also perform token replacement.
Parameters:
  resources - The underlying resource bundle to look at.
Parameters:
  locale - The requested message Locale.
Parameters:
  key - The key of the the message to be looked up.
Parameters:
  args - An array of arguments to be added to the message. the message with the tokens replaced.



hasTokens
public static boolean hasTokens(String input)(Code)
Returns a true if the input String consists of a tokenized string.
Parameters:
  input - the string to be checked for presence of tokens a true if the input String consists of a tokenized string.



removeTokenMarkers
public static String removeTokenMarkers(String input)(Code)
This is a convenience method to remove the token markers from the input string. This method will remove the markers at the beginning and at the end of the string only. Otherwise it'll simply return the input as is.
Parameters:
  input - The string from which the token markers are to be removed. The input string minus its outer token markers, if any.



replaceTokens
public static String replaceTokens(String message)(Code)
Replace the tokens in the input message with appropriate values from the default resources, as specified in the 'framework.messageResources.bundle' property of framework.properties files. A null will be returned in case an invalid or if no ResourceBundle is specified in the 'framework.messageResources.bundle' property of framework.properties file. It uses the locale for the user from the thread variable, if available, else it uses the default locale for the JVM. If the value for a token, is again a token, then it will recursively find the value.
Parameters:
  message - Message to be looked up for token replacement. the message with the tokens replaced.



replaceTokens
public static String replaceTokens(Locale locale, String message)(Code)
Replace the tokens in the input message with appropriate values from the default resources, as specified in the 'framework.messageResources.bundle' property of framework.properties files. A null will be returned in case an invalid or if no ResourceBundle is specified in the 'framework.messageResources.bundle' property of framework.properties file. If the value for a token, is again a token, then it will recursively find the value.
Parameters:
  locale - the Locale to be used when looking up the ResourceBundle.
Parameters:
  message - Message to be looked up for token replacement. the message with the tokens replaced.



replaceTokens
public static String replaceTokens(PageContext pageContext, String message)(Code)
Replace the tokens in the input message with appropriate values from the resources (an attribute in the request stream). This uses the default struts MessageResources and Locale. If the value for a token, is again a token, then it will recursively find the value.
Parameters:
  pageContext - The servlet pageContext we are processing.
Parameters:
  message - Message to be looked up for token replacement. the message with the tokens replaced.



replaceTokens
public static String replaceTokens(PageContext pageContext, String resources, String locale, String message)(Code)
Replace the tokens in the input message with appropriate values from the resources (an attribute in the request stream). If the value for a token, is again a token, then it will recursively find the value.
Parameters:
  pageContext - The servlet pageContext we are processing.
Parameters:
  resources - The key that identifies that the MessageResources object in the pageContext
Parameters:
  locale - The key that identifies that the Locale object in the pageContext
Parameters:
  message - Message to be looked up for token replacement. the message with the tokens replaced.



replaceTokens
public static String replaceTokens(MessageResources resources, Locale locale, String message)(Code)
Replace the tokens in the input message with appropriate values from the resources. If the value for a token, is again a token, then it will recursively find the value. Note: Ensure that are no cyclic references from one token to another to the first token.
Parameters:
  resources - The underlying resource bundle to look at.
Parameters:
  locale - The requested message Locale.
Parameters:
  message - Message to be looked up for token replacement. the message with the tokens replaced.



tokenize
public static String tokenize(String input)(Code)
This will add the Token Markers around the input String.
Parameters:
  input - the string to be tokenized. the string with the Token Markers around it. A null is returned if the input is null. If the input begins or ends with the token marker, then it will be returned as is.



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.