Java Doc for MessageResources.java in  » Web-Framework » struts-1.3.8 » org » apache » struts » 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 » Web Framework » struts 1.3.8 » org.apache.struts.util 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.apache.struts.util.MessageResources

All known Subclasses:   org.apache.struts.util.PropertyMessageResources,
MessageResources
abstract public class MessageResources implements Serializable(Code)
General purpose abstract class that describes an API for retrieving Locale-sensitive messages from underlying resource locations of an unspecified design, and optionally utilizing the MessageFormat class to produce internationalized messages with parametric replacement.

Calls to getMessage() variants without a Locale argument are presumed to be requesting a message string in the default Locale for this JVM.

Calls to getMessage() with an unknown key, or an unknown Locale will return null if the returnNull property is set to true. Otherwise, a suitable error message will be returned instead.

IMPLEMENTATION NOTE - Classes that extend this class must be Serializable so that instances may be used in distributable application server environments.
version:
   $Rev: 471754 $ $Date: 2005-08-29 23:57:50 -0400 (Mon, 29 Aug 2005)
version:
   $



Field Summary
protected  Stringconfig
     The configuration parameter used to initialize this MessageResources.
protected static  MessageResourcesFactorydefaultFactory
     The default MessageResourcesFactory used to create MessageResources instances.
protected  LocaledefaultLocale
     The default Locale for our environment.
protected  MessageResourcesFactoryfactory
     The MessageResourcesFactory that created this instance.
protected  HashMapformats
     The set of previously created MessageFormat objects, keyed by the key computed in messageKey().
protected static  Loglog
     Commons Logging instance.
protected  booleanreturnNull
     Indicate is a null is returned instead of an error message string when an unknown Locale or key is requested.

Constructor Summary
public  MessageResources(MessageResourcesFactory factory, String config)
     Construct a new MessageResources according to the specified parameters.
public  MessageResources(MessageResourcesFactory factory, String config, boolean returnNull)
     Construct a new MessageResources according to the specified parameters.

Method Summary
protected  Stringescape(String string)
     Escape any single quote characters that are included in the specified message string.
public  StringgetConfig()
     The configuration parameter used to initialize this MessageResources.
public  MessageResourcesFactorygetFactory()
     The MessageResourcesFactory that created this instance.
public  StringgetMessage(String key)
     Returns a text message for the specified key, for the default Locale.
public  StringgetMessage(String key, Object[] args)
     Returns a text message after parametric replacement of the specified parameter placeholders.
public  StringgetMessage(String key, Object arg0)
     Returns a text message after parametric replacement of the specified parameter placeholders.
public  StringgetMessage(String key, Object arg0, Object arg1)
     Returns a text message after parametric replacement of the specified parameter placeholders.
public  StringgetMessage(String key, Object arg0, Object arg1, Object arg2)
     Returns a text message after parametric replacement of the specified parameter placeholders.
public  StringgetMessage(String key, Object arg0, Object arg1, Object arg2, Object arg3)
     Returns a text message after parametric replacement of the specified parameter placeholders.
abstract public  StringgetMessage(Locale locale, String key)
     Returns a text message for the specified key, for the default Locale.
public  StringgetMessage(Locale locale, String key, Object[] args)
     Returns a text message after parametric replacement of the specified parameter placeholders.
public  StringgetMessage(Locale locale, String key, Object arg0)
     Returns a text message after parametric replacement of the specified parameter placeholders.
public  StringgetMessage(Locale locale, String key, Object arg0, Object arg1)
     Returns a text message after parametric replacement of the specified parameter placeholders.
public  StringgetMessage(Locale locale, String key, Object arg0, Object arg1, Object arg2)
     Returns a text message after parametric replacement of the specified parameter placeholders.
public  StringgetMessage(Locale locale, String key, Object arg0, Object arg1, Object arg2, Object arg3)
     Returns a text message after parametric replacement of the specified parameter placeholders.
public static synchronized  MessageResourcesgetMessageResources(String config)
     Create and return an instance of MessageResources for the created by the default MessageResourcesFactory.
public  booleangetReturnNull()
     Indicates that a null is returned instead of an error message string if an unknown Locale or key is requested.
public  booleanisEscape()
     Indicates whether 'escape processing' should be performed on the error message string.
public  booleanisPresent(String key)
     Return true if there is a defined message for the specified key in the system default locale.
public  booleanisPresent(Locale locale, String key)
     Return true if there is a defined message for the specified key in the specified Locale.
protected  StringlocaleKey(Locale locale)
     Compute and return a key to be used in caching information by a Locale.
public  voidlog(String message)
     Log a message to the Writer that has been configured for our use.
public  voidlog(String message, Throwable throwable)
     Log a message and exception to the Writer that has been configured for our use.
protected  StringmessageKey(Locale locale, String key)
     Compute and return a key to be used in caching information by Locale and message key.
protected  StringmessageKey(String localeKey, String key)
     Compute and return a key to be used in caching information by locale key and message key.
public  voidsetEscape(boolean escape)
     Set whether 'escape processing' should be performed on the error message string.
public  voidsetReturnNull(boolean returnNull)
     Indicates that a null is returned instead of an error message string if an unknown Locale or key is requested.

Field Detail
config
protected String config(Code)
The configuration parameter used to initialize this MessageResources.



defaultFactory
protected static MessageResourcesFactory defaultFactory(Code)
The default MessageResourcesFactory used to create MessageResources instances.



defaultLocale
protected Locale defaultLocale(Code)
The default Locale for our environment.



factory
protected MessageResourcesFactory factory(Code)
The MessageResourcesFactory that created this instance.



formats
protected HashMap formats(Code)
The set of previously created MessageFormat objects, keyed by the key computed in messageKey().



log
protected static Log log(Code)
Commons Logging instance.



returnNull
protected boolean returnNull(Code)
Indicate is a null is returned instead of an error message string when an unknown Locale or key is requested.




Constructor Detail
MessageResources
public MessageResources(MessageResourcesFactory factory, String config)(Code)
Construct a new MessageResources according to the specified parameters.
Parameters:
  factory - The MessageResourcesFactory that created us
Parameters:
  config - The configuration parameter for this MessageResources



MessageResources
public MessageResources(MessageResourcesFactory factory, String config, boolean returnNull)(Code)
Construct a new MessageResources according to the specified parameters.
Parameters:
  factory - The MessageResourcesFactory that created us
Parameters:
  config - The configuration parameter for thisMessageResources
Parameters:
  returnNull - The returnNull property we should initialize with




Method Detail
escape
protected String escape(String string)(Code)
Escape any single quote characters that are included in the specified message string.
Parameters:
  string - The string to be escaped



getConfig
public String getConfig()(Code)
The configuration parameter used to initialize this MessageResources. parameter used to initialize this MessageResources



getFactory
public MessageResourcesFactory getFactory()(Code)
The MessageResourcesFactory that created this instance. MessageResourcesFactory that created instance



getMessage
public String getMessage(String key)(Code)
Returns a text message for the specified key, for the default Locale.
Parameters:
  key - The message key to look up



getMessage
public String getMessage(String key, Object[] args)(Code)
Returns a text message after parametric replacement of the specified parameter placeholders.
Parameters:
  key - The message key to look up
Parameters:
  args - An array of replacement parameters for placeholders



getMessage
public String getMessage(String key, Object arg0)(Code)
Returns a text message after parametric replacement of the specified parameter placeholders.
Parameters:
  key - The message key to look up
Parameters:
  arg0 - The replacement for placeholder {0} in the message



getMessage
public String getMessage(String key, Object arg0, Object arg1)(Code)
Returns a text message after parametric replacement of the specified parameter placeholders.
Parameters:
  key - The message key to look up
Parameters:
  arg0 - The replacement for placeholder {0} in the message
Parameters:
  arg1 - The replacement for placeholder {1} in the message



getMessage
public String getMessage(String key, Object arg0, Object arg1, Object arg2)(Code)
Returns a text message after parametric replacement of the specified parameter placeholders.
Parameters:
  key - The message key to look up
Parameters:
  arg0 - The replacement for placeholder {0} in the message
Parameters:
  arg1 - The replacement for placeholder {1} in the message
Parameters:
  arg2 - The replacement for placeholder {2} in the message



getMessage
public String getMessage(String key, Object arg0, Object arg1, Object arg2, Object arg3)(Code)
Returns a text message after parametric replacement of the specified parameter placeholders.
Parameters:
  key - The message key to look up
Parameters:
  arg0 - The replacement for placeholder {0} in the message
Parameters:
  arg1 - The replacement for placeholder {1} in the message
Parameters:
  arg2 - The replacement for placeholder {2} in the message
Parameters:
  arg3 - The replacement for placeholder {3} in the message



getMessage
abstract public String getMessage(Locale locale, String key)(Code)
Returns a text message for the specified key, for the default Locale. A null string result will be returned by this method if no relevant message resource is found for this key or Locale, if the returnNull property is set. Otherwise, an appropriate error message will be returned.

This method must be implemented by a concrete subclass.
Parameters:
  locale - The requested message Locale, or null forthe system default Locale
Parameters:
  key - The message key to look up




getMessage
public String getMessage(Locale locale, String key, Object[] args)(Code)
Returns a text message after parametric replacement of the specified parameter placeholders. A null string result will be returned by this method if no resource bundle has been configured.
Parameters:
  locale - The requested message Locale, or null forthe system default Locale
Parameters:
  key - The message key to look up
Parameters:
  args - An array of replacement parameters for placeholders



getMessage
public String getMessage(Locale locale, String key, Object arg0)(Code)
Returns a text message after parametric replacement of the specified parameter placeholders. A null string result will never be returned by this method.
Parameters:
  locale - The requested message Locale, or null forthe system default Locale
Parameters:
  key - The message key to look up
Parameters:
  arg0 - The replacement for placeholder {0} in the message



getMessage
public String getMessage(Locale locale, String key, Object arg0, Object arg1)(Code)
Returns a text message after parametric replacement of the specified parameter placeholders. A null string result will never be returned by this method.
Parameters:
  locale - The requested message Locale, or null forthe system default Locale
Parameters:
  key - The message key to look up
Parameters:
  arg0 - The replacement for placeholder {0} in the message
Parameters:
  arg1 - The replacement for placeholder {1} in the message



getMessage
public String getMessage(Locale locale, String key, Object arg0, Object arg1, Object arg2)(Code)
Returns a text message after parametric replacement of the specified parameter placeholders. A null string result will never be returned by this method.
Parameters:
  locale - The requested message Locale, or null forthe system default Locale
Parameters:
  key - The message key to look up
Parameters:
  arg0 - The replacement for placeholder {0} in the message
Parameters:
  arg1 - The replacement for placeholder {1} in the message
Parameters:
  arg2 - The replacement for placeholder {2} in the message



getMessage
public String getMessage(Locale locale, String key, Object arg0, Object arg1, Object arg2, Object arg3)(Code)
Returns a text message after parametric replacement of the specified parameter placeholders. A null string result will never be returned by this method.
Parameters:
  locale - The requested message Locale, or null forthe system default Locale
Parameters:
  key - The message key to look up
Parameters:
  arg0 - The replacement for placeholder {0} in the message
Parameters:
  arg1 - The replacement for placeholder {1} in the message
Parameters:
  arg2 - The replacement for placeholder {2} in the message
Parameters:
  arg3 - The replacement for placeholder {3} in the message



getMessageResources
public static synchronized MessageResources getMessageResources(String config)(Code)
Create and return an instance of MessageResources for the created by the default MessageResourcesFactory.
Parameters:
  config - Configuration parameter for this message bundle.



getReturnNull
public boolean getReturnNull()(Code)
Indicates that a null is returned instead of an error message string if an unknown Locale or key is requested. true if null is returned if unknown key or locale is requested



isEscape
public boolean isEscape()(Code)
Indicates whether 'escape processing' should be performed on the error message string.
since:
   Struts 1.2.8



isPresent
public boolean isPresent(String key)(Code)
Return true if there is a defined message for the specified key in the system default locale.
Parameters:
  key - The message key to look up



isPresent
public boolean isPresent(Locale locale, String key)(Code)
Return true if there is a defined message for the specified key in the specified Locale.
Parameters:
  locale - The requested message Locale, or null forthe system default Locale
Parameters:
  key - The message key to look up



localeKey
protected String localeKey(Locale locale)(Code)
Compute and return a key to be used in caching information by a Locale. NOTE - The locale key for the default Locale in our environment is a zero length String.
Parameters:
  locale - The locale for which a key is desired



log
public void log(String message)(Code)
Log a message to the Writer that has been configured for our use.
Parameters:
  message - The message to be logged



log
public void log(String message, Throwable throwable)(Code)
Log a message and exception to the Writer that has been configured for our use.
Parameters:
  message - The message to be logged
Parameters:
  throwable - The exception to be logged



messageKey
protected String messageKey(Locale locale, String key)(Code)
Compute and return a key to be used in caching information by Locale and message key.
Parameters:
  locale - The Locale for which this format key is calculated
Parameters:
  key - The message key for which this format key is calculated



messageKey
protected String messageKey(String localeKey, String key)(Code)
Compute and return a key to be used in caching information by locale key and message key.
Parameters:
  localeKey - The locale key for which this cache key is calculated
Parameters:
  key - The message key for which this cache key iscalculated



setEscape
public void setEscape(boolean escape)(Code)
Set whether 'escape processing' should be performed on the error message string.
since:
   Struts 1.2.8



setReturnNull
public void setReturnNull(boolean returnNull)(Code)
Indicates that a null is returned instead of an error message string if an unknown Locale or key is requested.
Parameters:
  returnNull - true Indicates that a null is returnedif an unknown Locale or key is requested.



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.